1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-11-23 10:48:51 -05:00
glfw/tests/listmodes.c

49 lines
1.3 KiB
C
Raw Normal View History

2010-09-07 11:34:51 -04:00
//========================================================================
// This is a small test application for GLFW.
// The program lists all available fullscreen video modes.
//========================================================================
#include <stdio.h>
#include <GL/glfw3.h>
2010-09-07 11:34:51 -04:00
// Maximum number of modes that we want to list
#define MAX_NUM_MODES 400
//========================================================================
// main()
//========================================================================
int main( void )
{
GLFWvidmode dtmode, modes[ MAX_NUM_MODES ];
int modecount, i;
// Initialize GLFW
if( !glfwInit() )
{
return 0;
}
// Show desktop video mode
glfwGetDesktopMode( &dtmode );
printf( "Desktop mode: %d x %d x %d\n\n",
2010-09-08 10:50:50 -04:00
dtmode.width, dtmode.height, dtmode.redBits +
dtmode.greenBits + dtmode.blueBits );
2010-09-07 11:34:51 -04:00
// List available video modes
modecount = glfwGetVideoModes( modes, MAX_NUM_MODES );
printf( "Available modes:\n" );
for( i = 0; i < modecount; i ++ )
{
printf( "%3d: %d x %d x %d\n", i,
2010-09-08 10:50:50 -04:00
modes[i].width, modes[i].height, modes[i].redBits +
modes[i].greenBits + modes[i].blueBits );
2010-09-07 11:34:51 -04:00
}
// Terminate GLFW
glfwTerminate();
return 0;
}