Changeset af116c0 in network-game for graphics_library/main.cpp
- Timestamp:
- May 17, 2014, 3:11:41 PM (11 years ago)
- Branches:
- master
- Children:
- a9e808e
- Parents:
- 0b6f9ec
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
graphics_library/main.cpp
r0b6f9ec raf116c0 7 7 8 8 // Include GLFW 9 #include <GL/glfw.h> 9 #include <GLFW/glfw3.h> 10 GLFWwindow* window; 10 11 11 12 // Include GLM … … 27 28 } 28 29 29 glfw OpenWindowHint(GLFW_FSAA_SAMPLES, 4);30 glfw OpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3);31 glfw OpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 3);32 glfw OpenWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);30 glfwWindowHint(GLFW_SAMPLES, 4); 31 glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); 32 glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); 33 glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); 33 34 34 35 // Open a window and create its OpenGL context 35 if( !glfwOpenWindow( 1024, 768, 0,0,0,0, 32,0, GLFW_WINDOW ) )36 {36 window = glfwCreateWindow( 1024, 768, "Tutorial 0 - Keyboard and Mouse", NULL, NULL); 37 if( window == NULL ){ 37 38 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" ); 38 39 glfwTerminate(); 39 40 return -1; 40 41 } 42 glfwMakeContextCurrent(window); 41 43 42 44 // Initialize GLEW … … 47 49 } 48 50 49 glfwSetWindowTitle( "Tutorial 06" );50 51 51 // Ensure we can capture the escape key being pressed below 52 glfw Enable( GLFW_STICKY_KEYS);53 glfwSet MousePos(1024/2, 768/2);52 glfwSetInputMode(window, GLFW_STICKY_KEYS, GL_TRUE); 53 glfwSetCursorPos(window, 1024/2, 768/2); 54 54 55 55 // Dark blue background … … 227 227 228 228 // Swap buffers 229 glfwSwapBuffers(); 229 glfwSwapBuffers(window); 230 glfwPollEvents(); 230 231 231 232 } // Check if the ESC key was pressed or the window was closed 232 while( glfwGetKey( GLFW_KEY_ESC) != GLFW_PRESS &&233 glfw GetWindowParam( GLFW_OPENED ));233 while( glfwGetKey(window, GLFW_KEY_ESCAPE ) != GLFW_PRESS && 234 glfwWindowShouldClose(window) == 0 ); 234 235 235 236 // Cleanup VBO and shader
Note:
See TracChangeset
for help on using the changeset viewer.