• Create Account

### #ActualSuperVGA

Posted 13 October 2012 - 04:52 PM

What do you mean by “restarting” OpenGL?

Ah, I knew that wording would come back and bite me, but it's just the glut and glee initialization, as well as glutGamemode and the setting of the gl callbacks.

I know that the program loses its references (at least, the gl names don't exist no more) to the video ram when "resetting" as described above,
so I thought I wanted to wipe them before doing so, and then reestablish them afterwards.

How does a shader get “replaced”?

if( vs != 0 ) { glDeleteShader(vs); vs = 0; }
if( fs != 0 ) { glDeleteShader(fs); fs = 0; }



If this happens frequently and at run-time...

You're right. It's a remainder from when changing the size of a window meant reload some places, but lately it started meaning reshape instead.
The reloading bit doesn't really happen so often, I just like spending much more time making things tidy than making things.

It's nice of you to relieve me of my paranoid memory management fears in relation to shaders. -Thanks!

### #2SuperVGA

Posted 13 October 2012 - 04:50 PM

What do you mean by “restarting” OpenGL?

Ah, I knew that wording would come back and bite me, but it's just the glut and glee initialization, as well as glutGamemode and the setting of the gl callbacks.

I know that the program loses its references (at least, the gl names don't exist no more) to the video ram when "resetting" as described above,
so I thought I wanted to wipe them before doing so, and then reestablish them afterwards.

How does a shader get “replaced”?

if( vs != 0 ) { glDeleteShader(vs); vs = 0; }
if( fs != 0 ) { glDeleteShader(fs); fs = 0; }



If this happens frequently and at run-time...

You're right. It's a remainder from when changing the size of a window meant reload some places, but lately it started meaning reshape instead.
The reloading bit doesn't really happen so often, I just like spending much more time making things tidy than making things.

### #1SuperVGA

Posted 13 October 2012 - 04:50 PM

What do you mean by “restarting” OpenGL?

Ah, I knew that wording would come back and bite me, but it's just the glut and glee initialization, as well as glutGamemode and the setting of the gl callbacks.

I know that the program loses its references (at least, the gl names don't exist no more) to the video ram when "resetting" as described above,
so I thought I wanted to wipe them before doing so, and then reestablish them afterwards.

How does a shader get “replaced”?

if( vs != 0 ) { glDeleteShader(vs); vs = 0; }
if( fs != 0 ) { glDeleteShader(fs); fs = 0; }