Changes in graphics_library/main.cpp [af116c0:9cbdc9c] in network-game
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
graphics_library/main.cpp
raf116c0 r9cbdc9c 7 7 8 8 // Include GLFW 9 #include <GLFW/glfw3.h> 10 GLFWwindow* window; 9 #include <GL/glfw.h> 11 10 12 11 // Include GLM … … 28 27 } 29 28 30 glfw WindowHint(GLFW_SAMPLES, 4);31 glfw WindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);32 glfw WindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);33 glfw WindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);29 glfwOpenWindowHint(GLFW_FSAA_SAMPLES, 4); 30 glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3); 31 glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 3); 32 glfwOpenWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); 34 33 35 34 // Open a window and create its OpenGL context 36 window = glfwCreateWindow( 1024, 768, "Tutorial 0 - Keyboard and Mouse", NULL, NULL);37 if( window == NULL ){35 if( !glfwOpenWindow( 1024, 768, 0,0,0,0, 32,0, GLFW_WINDOW ) ) 36 { 38 37 fprintf( stderr, "Failed to open GLFW window. If you have an Intel GPU, they are not 3.3 compatible. Try the 2.1 version of the tutorials.\n" ); 39 38 glfwTerminate(); 40 39 return -1; 41 40 } 42 glfwMakeContextCurrent(window);43 41 44 42 // Initialize GLEW … … 49 47 } 50 48 49 glfwSetWindowTitle( "Tutorial 06" ); 50 51 51 // Ensure we can capture the escape key being pressed below 52 glfw SetInputMode(window, GLFW_STICKY_KEYS, GL_TRUE);53 glfwSet CursorPos(window,1024/2, 768/2);52 glfwEnable( GLFW_STICKY_KEYS ); 53 glfwSetMousePos(1024/2, 768/2); 54 54 55 55 // Dark blue background … … 227 227 228 228 // Swap buffers 229 glfwSwapBuffers(window); 230 glfwPollEvents(); 229 glfwSwapBuffers(); 231 230 232 231 } // Check if the ESC key was pressed or the window was closed 233 while( glfwGetKey( window, GLFW_KEY_ESCAPE) != GLFW_PRESS &&234 glfw WindowShouldClose(window) == 0);232 while( glfwGetKey( GLFW_KEY_ESC ) != GLFW_PRESS && 233 glfwGetWindowParam( GLFW_OPENED ) ); 235 234 236 235 // Cleanup VBO and shader
Note:
See TracChangeset
for help on using the changeset viewer.