Finding screen width and height dynamically in OpenGL GLUT program

glut, opengl

Solution

I think you are wrong, there are the following constants:

GLUT_SCREEN_HEIGHT
GLUT_SCREEN_WIDTH

I've tested it, it works.

Problem

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?

Original source