Short Question
Is there a way to nuke the server state in OpenGL? I.e. I want
GL_nuke();
to restore the GL server state to a “new” GL server. I.e. it should free up all textures, VBOs, FBOs, vertex shaders, fragment shaders, and anything else that might have been uploaded to the GL server.
Long Question
I’m developing an OpenGL app in Java with LWJGL. I’m currently working with hot code swapping. I would prefer to not have to:
* have a global list of all objects on the OpenGL server side
* and clear them on every code reload
Thus, I would prefer to have a:
* GL_nuke();
which would just free up all server side objects and return everything to a pristine environment.
No there is no way to do it using OpenGL API.
You could destroy, and recreate OpenGL context. Althoigh it will be expensive and will require using platform specific API (WGL, GLX, AGL, etc..)