• Advertisement
Sign in to follow this  

[.net] How to use a texture with different glContexts?

This topic is 3657 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I'm using C#, Tao for OpenGl and Tao.DevIl for the textures. I have several different windows in my application and each one has a "Tao.Platform.Windows.SimpleOpenGlControl" which is activated with ".MakeCurrent()" when the window is opened. I have one window that allows you to load textures and renders them. I save the texture references in static variables but when I close and reopen the window the textures are blank again. Are the textures bound to a specific "SimpleOpenGlControl" or should they be available untill the whole application is closed? Can anyone help?

Share this post


Link to post
Share on other sites
Advertisement
As a rule, resources such as textures are bound solely to the context that's active when it's created. When that context is lost, it's associated textures are lost as well.

However, you can instruct opengl to make resources shared between contexts with a platform specific function. In the case of windows, look up wglShareLists. Now how easy that would be to integrate into tao's SimpleOpenGLControls, I don't know. Personally I'd just ditch them and create the contexts myself so I have direct control.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement