OpenGL w/ glut


I wuz juz wondering if we can make fullscreen apps with glut. If so, please include a code snippet showing how to do so.



Of course, this assumes you’ve set up everything else (size, buffering mode, etc).

Does that help?


also as of glut3.7 theres a ‘game mode’ that does this as well a demo with source is included in the 3.7 distribution check under gameglut,asteroids (or something)

To use gameMode do one of two things,

when entering:

you need to pass a string to tell it what resolution and colour depth to use.

ie, glutGameModeString(“640x480:16@60”);

that gives the resolution, next the colour depth (16 24 or 32) and finally the refresh rate.

then you enter game mode:


when exiting the program you must do the following, otherwise funny things will happen.

query whether the game mode is active. If it is then leave game mode.

if(glutGet(GLUT_GAME_MODE_ACTIVE)) glutLeaveGameMode();

you’ll need to check the exact function calls but I think thats about right. Ensure that before you use it, you have a key or mouse press that will exit the program though!!!

Thank you guys for your responses. Really appreciate it.

Furthermore, don’t forget that when using gamemode you need to register all the callbacks and opengl context again. The game mode window is a separate window with a different context.