| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -35,7 +35,7 @@ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					#include "getopt.h" | 
					 | 
					 | 
					 | 
					#include "getopt.h" | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					static GLFWwindow window = NULL; | 
					 | 
					 | 
					 | 
					static GLFWwindow window_handle = NULL; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					enum Mode | 
					 | 
					 | 
					 | 
					enum Mode | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ | 
					 | 
					 | 
					 | 
					{ | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -68,25 +68,25 @@ static void error_callback(int error, const char* description) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    fprintf(stderr, "Error: %s\n", description); | 
					 | 
					 | 
					 | 
					    fprintf(stderr, "Error: %s\n", description); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					static void window_size_callback(GLFWwindow in_window, int width, int height) | 
					 | 
					 | 
					 | 
					static void window_size_callback(GLFWwindow window, int width, int height) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ | 
					 | 
					 | 
					 | 
					{ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    printf("Window resized to %ix%i\n", width, height); | 
					 | 
					 | 
					 | 
					    printf("Window resized to %ix%i\n", width, height); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    glViewport(0, 0, width, height); | 
					 | 
					 | 
					 | 
					    glViewport(0, 0, width, height); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					static int window_close_callback(GLFWwindow dummy) | 
					 | 
					 | 
					 | 
					static int window_close_callback(GLFWwindow window) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ | 
					 | 
					 | 
					 | 
					{ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    window = NULL; | 
					 | 
					 | 
					 | 
					    window_handle = NULL; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    return GL_TRUE; | 
					 | 
					 | 
					 | 
					    return GL_TRUE; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					static void key_callback(GLFWwindow dummy, int key, int action) | 
					 | 
					 | 
					 | 
					static void key_callback(GLFWwindow window, int key, int action) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ | 
					 | 
					 | 
					 | 
					{ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if (key == GLFW_KEY_ESCAPE) | 
					 | 
					 | 
					 | 
					    if (key == GLFW_KEY_ESCAPE) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { | 
					 | 
					 | 
					 | 
					    { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        glfwDestroyWindow(window); | 
					 | 
					 | 
					 | 
					        glfwDestroyWindow(window); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        window = NULL; | 
					 | 
					 | 
					 | 
					        window_handle = NULL; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -132,10 +132,10 @@ static void test_modes(void) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        printf("Testing mode %u: %s", (unsigned int) i, format_mode(mode)); | 
					 | 
					 | 
					 | 
					        printf("Testing mode %u: %s", (unsigned int) i, format_mode(mode)); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        window = glfwCreateWindow(mode->width, mode->height, | 
					 | 
					 | 
					 | 
					        window_handle = glfwCreateWindow(mode->width, mode->height, | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                                         GLFW_FULLSCREEN, "Video Mode Test", | 
					 | 
					 | 
					 | 
					                                         GLFW_FULLSCREEN, "Video Mode Test", | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                                         NULL); | 
					 | 
					 | 
					 | 
					                                         NULL); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if (!window) | 
					 | 
					 | 
					 | 
					        if (!window_handle) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        { | 
					 | 
					 | 
					 | 
					        { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            printf("Failed to enter mode %u: %s\n", | 
					 | 
					 | 
					 | 
					            printf("Failed to enter mode %u: %s\n", | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                   (unsigned int) i, | 
					 | 
					 | 
					 | 
					                   (unsigned int) i, | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -143,7 +143,7 @@ static void test_modes(void) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            continue; | 
					 | 
					 | 
					 | 
					            continue; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        glfwMakeContextCurrent(window); | 
					 | 
					 | 
					 | 
					        glfwMakeContextCurrent(window_handle); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        glfwSwapInterval(1); | 
					 | 
					 | 
					 | 
					        glfwSwapInterval(1); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        glfwSetTime(0.0); | 
					 | 
					 | 
					 | 
					        glfwSetTime(0.0); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -151,10 +151,10 @@ static void test_modes(void) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        while (glfwGetTime() < 5.0) | 
					 | 
					 | 
					 | 
					        while (glfwGetTime() < 5.0) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        { | 
					 | 
					 | 
					 | 
					        { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            glClear(GL_COLOR_BUFFER_BIT); | 
					 | 
					 | 
					 | 
					            glClear(GL_COLOR_BUFFER_BIT); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            glfwSwapBuffers(window); | 
					 | 
					 | 
					 | 
					            glfwSwapBuffers(window_handle); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            glfwPollEvents(); | 
					 | 
					 | 
					 | 
					            glfwPollEvents(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (!window) | 
					 | 
					 | 
					 | 
					            if (!window_handle) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            { | 
					 | 
					 | 
					 | 
					            { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                printf("User terminated program\n"); | 
					 | 
					 | 
					 | 
					                printf("User terminated program\n"); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                exit(EXIT_SUCCESS); | 
					 | 
					 | 
					 | 
					                exit(EXIT_SUCCESS); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -165,7 +165,7 @@ static void test_modes(void) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        glGetIntegerv(GL_GREEN_BITS, ¤t.greenBits); | 
					 | 
					 | 
					 | 
					        glGetIntegerv(GL_GREEN_BITS, ¤t.greenBits); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        glGetIntegerv(GL_BLUE_BITS, ¤t.blueBits); | 
					 | 
					 | 
					 | 
					        glGetIntegerv(GL_BLUE_BITS, ¤t.blueBits); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        glfwGetWindowSize(window, ¤t.width, ¤t.height); | 
					 | 
					 | 
					 | 
					        glfwGetWindowSize(window_handle, ¤t.width, ¤t.height); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if (current.redBits != mode->redBits || | 
					 | 
					 | 
					 | 
					        if (current.redBits != mode->redBits || | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            current.greenBits != mode->greenBits || | 
					 | 
					 | 
					 | 
					            current.greenBits != mode->greenBits || | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -185,9 +185,9 @@ static void test_modes(void) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        printf("Closing window\n"); | 
					 | 
					 | 
					 | 
					        printf("Closing window\n"); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        glfwDestroyWindow(window); | 
					 | 
					 | 
					 | 
					        glfwDestroyWindow(window_handle); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        window_handle = NULL; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        glfwPollEvents(); | 
					 | 
					 | 
					 | 
					        glfwPollEvents(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        window = NULL; | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |