Glut full screen

Posted on 2004-11-22
Last Modified: 2008-01-09
Any ideas on how to make a currently windowed glut app a fullscreen app?
Question by:OliWarner
    LVL 55

    Expert Comment

    by:Jaime Olivares
    Just match coordinates of window with screen coordinates. Use WINAPI's GetSystemMetrics() function to obtain current screen size in pixels, and also other dimensions like title bar height, window border size, etc.
    By example, if GetSystemMetrics returns you 1024 and 768, your window coordinates must be something like

    LVL 16

    Author Comment

    is there any way of forcing the screenmode to change so it takes up the entire screen... like any modern game does...
    LVL 9

    Accepted Solution


    quoted from the above site:


    glutGameModeString is a useful function for setting the screen resolution, refresh rate, and bit depth for fullscreen applications (like games). The sole parameter is a pointer to a string which specifies the screen properties desired.

    glutGameModeString( "640x480:16@60" );

    In the above example, this selects a resolution of 640x480, 16 bits per pixel (bit depth), and 60Hz refresh rate.

    int main(int argc, char * argv[])
        glutInit( &argc, argv );
        glutInitDisplayMode( GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH );
        glutGameModeString( "640x480:16@60" );

        // start fullscreen game mode

        glutDisplayFunc( display );
        glutKeyboardFunc( keyboard );
        glutIdleFunc( idle );

        // enter main loop

        return 0;

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
    What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
    The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
    The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now