Jump to content
  • Advertisement
Sign in to follow this  
patrrr

OpenGL Render device lost, or what?

This topic is 4323 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I have a problem with OpenGL + GLUT + Mac OS X: When I switch to/from game mode, OpenGL loses all textures that I have used (called glBindTexture on) and all values go back to default (front-facing polygon from ccw to cw, hints, etc.). The textures don't dissappear, they are still there but with no data and just 1x1 in dimension, this is quite weird because OpenGL is supposed to restore everything on a render context switch, right? I don't really think other apps have this problem; Quake3 manages to switch to and from fullscreen but I don't know whether it reloads everything... can this be a problem with GLUT? My textures are created with gluBuild2DMipmaps and I set state values just as they are supposed to set.

Share this post


Link to post
Share on other sites
Advertisement
From the glutEnterGamemode man page:
Quote:
glutEnterGamemode
glutEnterGameMode can be called when already in game mode. This will destroy the previous game mode window (including any OpenGL rendering state) and create a new game mode window with a new OpenGL rendering context. Also if glutEnterGameMode is called when already in game mode and if the game mode string has changed and describes a possible screen display format, the new screen display format takes effect. A reshape callback is generated if the game mode window changes size due to a screen display format change.

Re-entering game mode provides a mechanism for changing the screen display format while already in game mode. Note though that the game mode window's OpenGL state is lost in this process and the application is responsible for re-initializing the newly created game mode window OpenGL state when reentering game mode.

Although not directly mentioned for the first switch to game mode, I assume hat glutEnterGamemode ever makes a new unshared context. So its a concern of GLUT that the state becomes destroyed. OpenGL by itself would be able to transport all _shared_ data like textures, display lists, ... by using context sharing, but it seems that GLUT doesn't use that feature in the case of the game mode switching.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!