Changeset b33f87b in opengl-game


Ignore:
Timestamp:
Feb 26, 2017, 4:04:33 PM (8 years ago)
Author:
Dmitry Portnoy <dmp1488@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
8a6d19d
Parents:
4d52702
Message:

Use EXIT_SUCCESS and EXIT_FAILURE and add basic fullscreen support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • game.cpp

    r4d52702 rb33f87b  
    1515   #define MAC
    1616#endif
     17
     18#define FULLSCREEN false
    1719
    1820using namespace std;
     
    4042
    4143   // Create a GLFWwindow object that we can use for GLFW's functions
    42    GLFWwindow* window = glfwCreateWindow(WIDTH, HEIGHT, "LearnOpenGL", nullptr, nullptr);
     44   GLFWmonitor* monitor = FULLSCREEN ? glfwGetPrimaryMonitor() : nullptr;
     45   
     46   GLFWwindow* window = glfwCreateWindow(WIDTH, HEIGHT, "LearnOpenGL", monitor, nullptr);
    4347   glfwMakeContextCurrent(window);
    4448   if (window == NULL) {
    4549      cout << "Failed to create GLFW window" << endl;
    4650      glfwTerminate();
    47       return -1;
     51      return EXIT_FAILURE;
    4852   }
    4953
     
    5660   if (glewInit() != GLEW_OK) {
    5761      cout << "Failed to initialize GLEW" << endl;
    58       return -1;
     62      return EXIT_FAILURE;
    5963   }   
    6064
     
    7983
    8084   glfwTerminate();
    81    return 0;
     85   return EXIT_SUCCESS;
    8286}
    8387
Note: See TracChangeset for help on using the changeset viewer.