Changeset fccd588 in network-game for graphics_library


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

Location:
graphics_library
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • graphics_library/TextureFragmentShader.fragmentshader

    r8cbeffc rfccd588  
    1313
    1414        // Output color = color of the texture at the specified UV
    15         color = texture2D( myTextureSampler, UV ).rgb;
     15        color = texture( myTextureSampler, UV ).rgb;
    1616}
  • 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
  • graphics_library/makefile

    r8cbeffc rfccd588  
     1OS = $(shell uname)
    12CC = g++
    2 LIB_FLAGS = -lGL -lglut -lGLEW `pkg-config glfw3 --static --cflags --libs`
    33FLAGS = -Wall
    44DEPENDENCIES = common/texture.o common/controls.o common/shader.o
     5
     6ifeq ($(OS),Darwin)
     7        LIB_FLAGS = -framework Cocoa -framework OpenGL -framework IOKit -framework CoreVideo -lglfw3 -lglew
     8endif
     9ifeq ($(OS),Linux)
     10        LIB_FLAGS = -lGL -lglut -lGLEW `pkg-config glfw3 --static --cflags --libs`
     11endif
    512
    613graphics_engine : main.cpp $(DEPENDENCIES)
Note: See TracChangeset for help on using the changeset viewer.