DJ Tricky S
09-29-2000, 07:15 PM
I am finishing up an OpenGL game (runs full screen) which allows the user to change the resolution in-game. There is a problem though; after switching resolutions, a couple of my textures appear to be corrupted. While you might think "of course they are, they are getting kicked around during the switch", I am taking every precaution to make sure that won't happen, and can't understand what is wrong. What I do when the user picks a new display setting is:
- destroy my gl render context and display context
- change the display setting via ChangeDisplaySettings()
- create a new display context from my enlarged window, and then a new render context from that
- set the current context
- delete all my textures via glDeleteTextures
- reload all textures from scratch
- continue on my merry way
It seems like this should work, but there will always be one or two textures that end up looking hosed after doing this. Does anyone have any ideas on what I might be doing wrong, or some sample code on a sure-fire way to switch resolutions on the fly?
- destroy my gl render context and display context
- change the display setting via ChangeDisplaySettings()
- create a new display context from my enlarged window, and then a new render context from that
- set the current context
- delete all my textures via glDeleteTextures
- reload all textures from scratch
- continue on my merry way
It seems like this should work, but there will always be one or two textures that end up looking hosed after doing this. Does anyone have any ideas on what I might be doing wrong, or some sample code on a sure-fire way to switch resolutions on the fly?