Moved listmodes test program to tests directory.

This commit is contained in:
Camilla Berglund
2010-10-04 21:14:58 +02:00
parent afb1c68791
commit 9e1031a35a
3 changed files with 5 additions and 9 deletions
+3 -1
View File
@@ -8,6 +8,7 @@ add_executable(events events.c)
add_executable(fsfocus fsfocus.c)
add_executable(iconify iconify.c getopt.c)
add_executable(joysticks joysticks.c)
add_executable(listmodes listmodes.c)
add_executable(peter peter.c)
add_executable(reopen reopen.c)
add_executable(version version.c getopt.c)
@@ -29,7 +30,8 @@ else()
endif(APPLE)
set(WINDOWS_BINARIES accuracy sharing tearing windows)
set(CONSOLE_BINARIES defaults events fsaa fsfocus iconify joysticks peter reopen version)
set(CONSOLE_BINARIES defaults events fsaa fsfocus iconify joysticks listmodes
peter reopen version)
if(MSVC)
# Tell MSVC to use main instead of WinMain for Windows subsystem executables
+48
View File
@@ -0,0 +1,48 @@
//========================================================================
// This is a small test application for GLFW.
// The program lists all available fullscreen video modes.
//========================================================================
#include <stdio.h>
#include <GL/glfw3.h>
// 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",
dtmode.width, dtmode.height, dtmode.redBits +
dtmode.greenBits + dtmode.blueBits );
// 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,
modes[i].width, modes[i].height, modes[i].redBits +
modes[i].greenBits + modes[i].blueBits );
}
// Terminate GLFW
glfwTerminate();
return 0;
}