View Full Version : Regarding textures on display mode change...

12-11-2003, 03:59 AM

This is the scenario:

I have a program doing GL rendering on Windows XP running on NV25. I need to support fullscreen rendering switch using Alt+Enter so I create a popup window irrespective of whether the program is running fullscreen or windowed.

However on ALT+Enter with switch from 16bit rendering to 32bit rendering (selected in game) or vice versa I need to do a display mode change after which some of the GL context's state seems to have been lost.

My question is this: Does the driver save the context across display mode changes or when the OpenGL server's state changes?

If this question seems out of place, I'm very sorry.

- Uday

12-11-2003, 05:40 AM
You have selected a pixelformat in one color resolution and switch to a different color resolution which doesn't even advertise these same pixelformats!?
Be thankful that you see anything afterwards.
Doing this in the same color resolution is a lesser problem and should work.
Going fullscreen can also be done by not switching the resolution, just change the client size to be the desktop's size and position the window properly, or use a popup window without border.
OpenGL doesn't know about windows management, you're responsible to handle this on application side.
What you really should do is to throw your complete context and window away and start from scratch in the new resolution. This is the only way to get reliable results on different implementations.
There are messages like WM_DEVMODECHANGE and WM_DISPLAYCHANGE to get the notification.

This response is a little biased because I hate programs changing my display settings anyway. Why don't games simply work windowed or the resolution and refresh rate(!) the desktop runs in at startup time.

(Yeah, 1000's post http://www.opengl.org/discussion_boards/ubb/wink.gif)

[This message has been edited by Relic (edited 12-11-2003).]