Raz Posted May 28, 2011 Share Posted May 28, 2011 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 Quote Link to comment Share on other sites More sharing options...
Josh Posted May 28, 2011 Share Posted May 28, 2011 That should work if you attach the texture to a buffer, enable the buffer, then call that command. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Raz Posted May 28, 2011 Author Share Posted May 28, 2011 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.