Archived

This topic is now archived and is closed to further replies.

How do I use full screen in glut??

This topic is 5015 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

It depends on the version of GLUT you are using, if you are using below version 3.7 the only way to do fullscreen is to use the function glutFullscreen() but this only opens a screen with the properties of the desktop e.g. if your desktop was 1024x768 and colour depth was 32 bit then your fullscreen app would be this size.

With GLUT versions higher than 3.7 though there are a few new functions that you can use.
First you have to set up the properties of the window using this function:
void glutGameModeString(const char *string)
which has to be in the format of
"width x height : colorDepth @ refreshRate"
then you use the function:
int glutEnterGameMode(void) to actually open the window.
A little example here then:

int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutGameModeString("1024x768:32@60");
glutEnterGameMode();
//set up the render functions etc as you normally would

glutMainLoop();
return 0;
}


hope that helps and that i wrote it all properly


If there''s an order in all of this disorder
is it like a tape recorder?
Can we rewind it just once more?

Share this post


Link to post
Share on other sites