Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main()
- {
- GLFWwindow* window;
- if ( !glfwInit() )
- {
- logFile.Printf( "Error glfwInit()\n" );
- return -1;
- }
- glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
- glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
- glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
- glfwSwapInterval(60);
- window = glfwCreateWindow( App::WINDOW_X, App::WINDOW_Y, App::WIN_TITLE, NULL, NULL );
- if ( !window )
- {
- logFile.Printf( "Error create glfw window\n" );
- glfwTerminate();
- return -1;
- }
- glfwMakeContextCurrent( window );
- App::InitGLEW();
- GL_setup();
- CreateTextures();
- SetupShaders();
- double lastTime = App::GetSysTime();
- while ( !glfwWindowShouldClose( window ) )
- {
- double thisTime = App::GetSysTime();
- Update( thisTime - lastTime );
- lastTime = thisTime;
- GL_render();
- glfwSwapBuffers( window );
- glfwPollEvents();
- }
- ExitProgram();
- glfwTerminate();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement