mirror of
https://github.com/glfw/glfw.git
synced 2026-08-28 20:15:54 +02:00
Moved listmodes test program to tests directory.
This commit is contained in:
@@ -5,8 +5,6 @@ link_libraries(libglfwStatic ${GLFW_LIBRARIES} ${OPENGL_glu_LIBRARY})
|
||||
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../include ${OPENGL_INCLUDE_DIR})
|
||||
|
||||
add_executable(listmodes listmodes.c)
|
||||
|
||||
if(APPLE)
|
||||
# Set fancy names for bundles
|
||||
add_executable(Boing MACOSX_BUNDLE boing.c)
|
||||
@@ -25,21 +23,17 @@ else(APPLE)
|
||||
endif(APPLE)
|
||||
|
||||
set(WINDOWS_BINARIES boing gears heightmap splitview triangle wave)
|
||||
set(CONSOLE_BINARIES listmodes)
|
||||
|
||||
if(MSVC)
|
||||
# Tell MSVC to use main instead of WinMain for Windows subsystem executables
|
||||
set_target_properties(${WINDOWS_BINARIES} ${CONSOLE_BINARIES}
|
||||
set_target_properties(${WINDOWS_BINARIES}
|
||||
PROPERTIES LINK_FLAGS "/ENTRY:mainCRTStartup")
|
||||
endif(MSVC)
|
||||
|
||||
if(CYGWIN)
|
||||
# Set cross-compile and subsystem compile and link flags
|
||||
set_target_properties(${WINDOWS_BINARIES} ${CONSOLE_BINARIES}
|
||||
PROPERTIES COMPILE_FLAGS "-mno-cygwin")
|
||||
set_target_properties(${WINDOWS_BINARIES}
|
||||
PROPERTIES COMPILE_FLAGS "-mno-cygwin"
|
||||
PROPERTIES LINK_FLAGS "-mno-cygwin -mwindows")
|
||||
set_target_properties(${CONSOLE_BINARIES}
|
||||
PROPERTIES LINK_FLAGS "-mno-cygwin -mconsole")
|
||||
endif(CYGWIN)
|
||||
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
//========================================================================
|
||||
// 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;
|
||||
}
|
||||
Reference in New Issue
Block a user