In my OpenGL program, in order to run it in fullscreen mode, I'm using the GLUT function glutGameModeString(const char *string).
(where 'string' specifies the screen width,height,pixelDepth and refresh rate)

To make it working in any system,i need to dynamically determine the screen width and screen height of the host system, prior to making the call to 'glutGameModeString' function.
How do I do that?

(I just need to know how to retrieve the screen height and width in windows)

07-23-2012, 10:28 AM

Alfonse Reinheart

You stop using GLUT and use a system that's designed to be used for this sort of thing. GLUT has no function for this sort of thing, and OpenGL doesn't know of anything outside of the window.

In my OpenGL program, in order to run it in fullscreen mode ... To make it working in any system,i need to dynamically determine the screen width and screen height of the host system

What about just using the default:

Per the API docs "glutGameModeString: Specify the display mode that should be entered when GameMode is entered. Default is the current display mode of the monitor on which the GameMode screen will be opened. "

Both of these have uses other than just for helping with going to and from fullscreen mode; the working area size is particularly useful for setting an upper bound on the largest windowed mode you might wish to support, and can also be used for centering your window properly on the screen.