OpenGL Nuking Server Status

Short question

Is there a way to reassign server status in OpenGL? That is, I want

GL_nuke();

to restore the state of the GL server on the "new" GL server. That is, it should free all textures, VBOs, FBOs, vertex shaders, fragment shaders, and everything that could be uploaded to the GL server.

Long question

I am developing an OpenGL Java application with LWJGL. I am currently working with a hot-code exchange. I would rather not do this:

* have a global list of all objects on the OpenGL server side
* and clear them on every code reload

So I would rather have:

* GL_nuke();

which will simply release all objects on the server side and return everything to the pristine environment.

+3
source share
1 answer

There is no way to do this using the OpenGL API.

You can destroy and recreate the OpenGL context. Althoigh will be expensive and require the use of a platform-specific API (WGL, GLX, AGL, etc.).

+4
source

All Articles