Changeset fccd588 in network-game for graphics_library/main.cpp


Ignore:
Timestamp:
Jan 8, 2019, 9:43:52 PM (6 years ago)
Author:
dportnoy15 <dmitry.portnoy@…>
Branches:
master
Children:
ea3a3a9
Parents:
8cbeffc
Message:

Make the graphics library project compile successfully on a Mac

File:
1 edited

Legend:

Unmodified
Added
Removed
  • graphics_library/main.cpp

    r8cbeffc rfccd588  
    1919#include "common/controls.hpp"
    2020
    21 int main( void )
    22 {
     21int main( void ) {
    2322        // Initialise GLFW
    24         if( !glfwInit() )
    25         {
     23        if( !glfwInit() ) {
    2624                fprintf( stderr, "Failed to initialize GLFW\n" );
    2725                return -1;
    2826        }
    2927
    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);
     28        #ifdef __APPLE__
     29            glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
     30            glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
     31            glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
     32            glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
     33        #else
     34            glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
     35            glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
     36        #endif
    3437
    3538        // Open a window and create its OpenGL context
Note: See TracChangeset for help on using the changeset viewer.