Advertisement
Guest User

Untitled

a guest
Nov 2nd, 2014
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. int main()
  2. {
  3. GLFWwindow* window;
  4.  
  5. if ( !glfwInit() )
  6. {
  7. logFile.Printf( "Error glfwInit()\n" );
  8. return -1;
  9. }
  10.  
  11.  
  12. glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
  13. glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
  14. glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
  15. glfwSwapInterval(60);
  16.  
  17. window = glfwCreateWindow( App::WINDOW_X, App::WINDOW_Y, App::WIN_TITLE, NULL, NULL );
  18. if ( !window )
  19. {
  20. logFile.Printf( "Error create glfw window\n" );
  21. glfwTerminate();
  22. return -1;
  23. }
  24.  
  25.  
  26. glfwMakeContextCurrent( window );
  27.  
  28. App::InitGLEW();
  29.  
  30. GL_setup();
  31.  
  32. CreateTextures();
  33. SetupShaders();
  34.  
  35. double lastTime = App::GetSysTime();
  36. while ( !glfwWindowShouldClose( window ) )
  37. {
  38. double thisTime = App::GetSysTime();
  39.  
  40. Update( thisTime - lastTime );
  41. lastTime = thisTime;
  42.  
  43. GL_render();
  44.  
  45. glfwSwapBuffers( window );
  46.  
  47. glfwPollEvents();
  48. }
  49.  
  50. ExitProgram();
  51.  
  52. glfwTerminate();
  53. return 0;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement