Jump to content

Another render to texture question ;)


Raz
 Share

Recommended Posts

Hey there!

Just a quick question. Is it possible to access the raw texture data of a TTexture and write to it using OpenGL functions, for example like this:

 

glDrawPixels(width, height, GL_RGBA, GL_UNSIGNED_BYTE, pRawImageData);

 

Greets,

Philipp

Link to comment
Share on other sites

Okay, that seems to work just fine inside Leadwerks' OpenGL render context. Now, assuming I want to use this feature in C# (or .Net in general) as well, possibly using the OpenTK framework..

I found this page: http://www.opentk.com/doc/graphics/graphicscontext/external explaining how to use external contexts with OpenTK.

As I assume, you have to place the call to OpenTK's CreateDummyContext() after the call to LE's Graphics(), cause that's where the OpenGL context in LE is created, right? The documentation mentions that the function requires a context being active on the calling thread. I assume that after calling Graphics() on the same thread as CreateDummyContext(), a context should be active.

 

Nevertheless, all I get returned when calling CreateDummyContext() is a short print() to the console telling me that "No graphics context is active on the calling thread", immediately closing the entire app.

 

Btw, on a side note, is there a built-in way to alter the render window's icon? Or will I have to use whatever OS commands are available?

 

Greets,

Philipp

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...