Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding screen width and height dynamically in OpenGL GLUT program

Tags:

opengl

glut

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?

like image 278
itsraining Avatar asked Oct 18 '25 18:10

itsraining


1 Answers

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

GLUT_SCREEN_HEIGHT
GLUT_SCREEN_WIDTH

I've tested it, it works.

like image 148
Samuel Allan Avatar answered Oct 20 '25 16:10

Samuel Allan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!