Changeset fccd588 in network-game
- Timestamp:
- Jan 8, 2019, 9:43:52 PM (6 years ago)
- Branches:
- master
- Children:
- ea3a3a9
- Parents:
- 8cbeffc
- Location:
- graphics_library
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
graphics_library/TextureFragmentShader.fragmentshader
r8cbeffc rfccd588 13 13 14 14 // Output color = color of the texture at the specified UV 15 color = texture 2D( myTextureSampler, UV ).rgb;15 color = texture( myTextureSampler, UV ).rgb; 16 16 } -
graphics_library/main.cpp
r8cbeffc rfccd588 19 19 #include "common/controls.hpp" 20 20 21 int main( void ) 22 { 21 int main( void ) { 23 22 // Initialise GLFW 24 if( !glfwInit() ) 25 { 23 if( !glfwInit() ) { 26 24 fprintf( stderr, "Failed to initialize GLFW\n" ); 27 25 return -1; 28 26 } 29 27 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 34 37 35 38 // Open a window and create its OpenGL context -
graphics_library/makefile
r8cbeffc rfccd588 1 OS = $(shell uname) 1 2 CC = g++ 2 LIB_FLAGS = -lGL -lglut -lGLEW `pkg-config glfw3 --static --cflags --libs`3 3 FLAGS = -Wall 4 4 DEPENDENCIES = common/texture.o common/controls.o common/shader.o 5 6 ifeq ($(OS),Darwin) 7 LIB_FLAGS = -framework Cocoa -framework OpenGL -framework IOKit -framework CoreVideo -lglfw3 -lglew 8 endif 9 ifeq ($(OS),Linux) 10 LIB_FLAGS = -lGL -lglut -lGLEW `pkg-config glfw3 --static --cflags --libs` 11 endif 5 12 6 13 graphics_engine : main.cpp $(DEPENDENCIES)
Note:
See TracChangeset
for help on using the changeset viewer.