• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 579
  • Last Modified:

Glut full screen

Any ideas on how to make a currently windowed glut app a fullscreen app?
0
OliWarner
Asked:
OliWarner
1 Solution
 
Jaime OlivaresCommented:
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

(-5,-25,1029,773)
0
 
OliWarnerAuthor Commented:
is there any way of forcing the screenmode to change so it takes up the entire screen... like any modern game does...
0
 
jhshuklaCommented:
http://www.nullterminator.net/glut.html

quoted from the above site:

glutGameModeString

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
    glutEnterGameMode();

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

    // enter main loop
    glutMainLoop();

    return 0;
}
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now