PDA

View Full Version : Reinitializing OpenGL and SDL



darkrappey
02-01-2007, 04:13 PM
I'm not sure if this belongs on a SDL forum or OpenGL forums, but I cant even find a SDL forum so here goes:

In SDL I there is this deal where if you reset the video mode (change resolution etc) all of OpenGL's state is lost. I can't find the article that states what exactly is lost, but I know it at least includes cached Textures and Display Lists.

In order to allow the game to change resolutions during run-time/game-play it must reload everything.

I'm pretty sure my functions for reloading textures and static meshes are working, but I am still doing something wrong.

Wat would cause this : http://img459.imageshack.us/img459/6520/screen2cd7.jpg

To look like this: http://img459.imageshack.us/img459/5646/screenhn1.jpg

It is possible textures are not loading correctly, would that explain every thing in that picture?
Is the lighting also not working?

Korval
02-01-2007, 05:45 PM
It is possible textures are not loading correctly, would that explain every thing in that picture? Looks like it. It would appear that the texture is not being bound, or the texture object is not being properly created/uploaded.

darkrappey
02-02-2007, 03:29 PM
Oh! Never mind, I fixed it. In loosing its state it was acting as if GL_TEXTURE_2D disabled.

I simply re-enabled it (glEnable( GL_TEXTURE_2D )) among other things and it works.

Sorry to waste any of your time...

Hopefully this will be useful to someone with the same problem...

(thanks for your reply Korval)