Sign in to follow this  
Loo Wang

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

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this