From b62bbb78ed1ddf1b0cd7af150c715d440e78265e Mon Sep 17 00:00:00 2001 From: Chris Hemingway Date: Fri, 13 May 2016 23:01:48 +0100 Subject: [PATCH 1/4] Fix building examples on OSX --- examples/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/Makefile b/examples/Makefile index 74335fe8..534adee8 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -85,6 +85,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) # add standard directories for GNU/Linux ifeq ($(PLATFORM_OS),LINUX) INCLUDES = -I. -I../src -I/usr/local/include/raylib/ + else ifeq ($(PLATFORM_OS),OSX) + INCLUDES = -I. -I../src else INCLUDES = -I. -I../../src -IC:/raylib/raylib/src # external libraries headers @@ -103,6 +105,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) # add standard directories for GNU/Linux ifeq ($(PLATFORM_OS),LINUX) LFLAGS = -L. -L../../src + else ifeq ($(PLATFORM_OS),OSX) + LFLAGS = -L. -L../src else LFLAGS = -L. -L../../src -LC:/raylib/raylib/src # external libraries to link with @@ -129,7 +133,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) # libraries for OS X 10.9 desktop compiling # requires the following packages: # libglfw3-dev libopenal-dev libegl1-mesa-dev - LIBS = -lraylib -lglfw -framework OpenGL -framework OpenAl -framework Cocoa + LIBS = -lraylib -lglfw3 -framework OpenGL -framework OpenAl -framework Cocoa else # libraries for Windows desktop compiling # NOTE: GLFW3 and OpenAL Soft libraries should be installed From b46a8005979bb626f4e7a7199932c4b85e9efb3a Mon Sep 17 00:00:00 2001 From: Chris Hemingway Date: Sat, 14 May 2016 01:10:05 +0100 Subject: [PATCH 2/4] Make GRAPHICS_API_OPENGL_33 work on OSX, closes #113 --- src/core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core.c b/src/core.c index 54d42f83..a94ad48d 100644 --- a/src/core.c +++ b/src/core.c @@ -1447,7 +1447,11 @@ static void InitDisplay(int width, int height) glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); // Choose OpenGL minor version (just hint) glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // Profiles Hint: Only 3.3 and above! // Other values: GLFW_OPENGL_ANY_PROFILE, GLFW_OPENGL_COMPAT_PROFILE +#ifdef __APPLE__ + glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // OSX Requires +#else glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_FALSE); // Fordward Compatibility Hint: Only 3.3 and above! +#endif //glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GL_TRUE); } From f575935ace109149277a57f6216c5df1b94eeac9 Mon Sep 17 00:00:00 2001 From: Chris Hemingway Date: Sat, 14 May 2016 10:45:29 +0100 Subject: [PATCH 3/4] Fix glfw name on OSX and remove unused directory warning --- templates/advance_game/Makefile | 7 +++++-- templates/basic_game/Makefile | 5 ++++- templates/basic_test/Makefile | 7 +++++-- templates/simple_game/Makefile | 7 +++++-- templates/standard_game/Makefile | 7 +++++-- 5 files changed, 24 insertions(+), 9 deletions(-) diff --git a/templates/advance_game/Makefile b/templates/advance_game/Makefile index ee982de4..b3947205 100644 --- a/templates/advance_game/Makefile +++ b/templates/advance_game/Makefile @@ -109,7 +109,10 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),LINUX) LFLAGS = -L. -L../../src else - LFLAGS = -L. -L../../src -LC:/raylib/raylib/src + LFLAGS = -L. -L../../src + ifeq ($(PLATFORM_OS),WINDOWS) + LFLAGS += -LC:/raylib/raylib/src + endif # external libraries to link with # GLFW3 LFLAGS += -L../../external/glfw3/lib/$(LIBPATH) @@ -134,7 +137,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) # libraries for OS X 10.9 desktop compiling # requires the following packages: # libglfw3-dev libopenal-dev libegl1-mesa-dev - LIBS = -lraylib -lglfw -framework OpenGL -framework OpenAl -framework Cocoa + LIBS = -lraylib -lglfw3 -framework OpenGL -framework OpenAl -framework Cocoa else # libraries for Windows desktop compiling # NOTE: GLFW3 and OpenAL Soft libraries should be installed diff --git a/templates/basic_game/Makefile b/templates/basic_game/Makefile index 3b2a06d0..76337490 100644 --- a/templates/basic_game/Makefile +++ b/templates/basic_game/Makefile @@ -109,7 +109,10 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),LINUX) LFLAGS = -L. -L../../src else - LFLAGS = -L. -L../../src -LC:/raylib/raylib/src + LFLAGS = -L. -L../../src + ifeq ($(PLATFORM_OS),WINDOWS) + LFLAGS += -LC:/raylib/raylib/src + endif # external libraries to link with # GLFW3 LFLAGS += -L../../external/glfw3/lib/$(LIBPATH) diff --git a/templates/basic_test/Makefile b/templates/basic_test/Makefile index b08aacdf..b6fd44a7 100644 --- a/templates/basic_test/Makefile +++ b/templates/basic_test/Makefile @@ -108,7 +108,10 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),LINUX) LFLAGS = -L. -L../../src else - LFLAGS = -L. -L../../src -LC:/raylib/raylib/src + LFLAGS = -L. -L../../src + ifeq ($(PLATFORM_OS),WINDOWS) + LFLAGS += -LC:/raylib/raylib/src + endif # external libraries to link with # GLFW3 LFLAGS += -L../../external/glfw3/lib/$(LIBPATH) @@ -133,7 +136,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) # libraries for OS X 10.9 desktop compiling # requires the following packages: # libglfw3-dev libopenal-dev libegl1-mesa-dev - LIBS = -lraylib -lglfw -framework OpenGL -framework OpenAl -framework Cocoa + LIBS = -lraylib -lglfw3 -framework OpenGL -framework OpenAl -framework Cocoa else # libraries for Windows desktop compiling # NOTE: GLFW3 and OpenAL Soft libraries should be installed diff --git a/templates/simple_game/Makefile b/templates/simple_game/Makefile index 6a3adcc8..3d303082 100644 --- a/templates/simple_game/Makefile +++ b/templates/simple_game/Makefile @@ -109,7 +109,10 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),LINUX) LFLAGS = -L. -L../../src else - LFLAGS = -L. -L../../src -LC:/raylib/raylib/src + LFLAGS = -L. -L../../src + ifeq ($(PLATFORM_OS),WINDOWS) + LFLAGS += -LC:/raylib/raylib/src + endif # external libraries to link with # GLFW3 LFLAGS += -L../../external/glfw3/lib/$(LIBPATH) @@ -134,7 +137,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) # libraries for OS X 10.9 desktop compiling # requires the following packages: # libglfw3-dev libopenal-dev libegl1-mesa-dev - LIBS = -lraylib -lglfw -framework OpenGL -framework OpenAl -framework Cocoa + LIBS = -lraylib -lglfw3 -framework OpenGL -framework OpenAl -framework Cocoa else # libraries for Windows desktop compiling # NOTE: GLFW3 and OpenAL Soft libraries should be installed diff --git a/templates/standard_game/Makefile b/templates/standard_game/Makefile index 4629d1b1..c7cb7add 100644 --- a/templates/standard_game/Makefile +++ b/templates/standard_game/Makefile @@ -109,7 +109,10 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),LINUX) LFLAGS = -L. -L../../src else - LFLAGS = -L. -L../../src -LC:/raylib/raylib/src + LFLAGS = -L. -L../../src + ifeq ($(PLATFORM_OS),WINDOWS) + LFLAGS += -LC:/raylib/raylib/src + endif # external libraries to link with # GLFW3 LFLAGS += -L../../external/glfw3/lib/$(LIBPATH) @@ -134,7 +137,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) # libraries for OS X 10.9 desktop compiling # requires the following packages: # libglfw3-dev libopenal-dev libegl1-mesa-dev - LIBS = -lraylib -lglfw -framework OpenGL -framework OpenAl -framework Cocoa + LIBS = -lraylib -lglfw3 -framework OpenGL -framework OpenAl -framework Cocoa else # libraries for Windows desktop compiling # NOTE: GLFW3 and OpenAL Soft libraries should be installed From 0e29aa2951fe11e9d0fabec2182ed6309fce37bb Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 17 May 2016 00:39:56 +0200 Subject: [PATCH 4/4] Corrected function name texture2D() is deprecated on GLSL 330 --- examples/resources/shaders/glsl330/bloom.fs | 2 +- examples/resources/shaders/glsl330/swirl.fs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/resources/shaders/glsl330/bloom.fs b/examples/resources/shaders/glsl330/bloom.fs index c8cb0d32..47ddee30 100644 --- a/examples/resources/shaders/glsl330/bloom.fs +++ b/examples/resources/shaders/glsl330/bloom.fs @@ -22,7 +22,7 @@ void main() { for (int j = -3; j < 3; j++) { - sum += texture2D(texture0, fragTexCoord + vec2(j, i)*0.004)*0.25; + sum += texture(texture0, fragTexCoord + vec2(j, i)*0.004)*0.25; } } diff --git a/examples/resources/shaders/glsl330/swirl.fs b/examples/resources/shaders/glsl330/swirl.fs index b1dc82f0..da098754 100644 --- a/examples/resources/shaders/glsl330/swirl.fs +++ b/examples/resources/shaders/glsl330/swirl.fs @@ -40,7 +40,7 @@ void main (void) } tc += center; - vec3 color = texture2D(texture0, tc/texSize).rgb; + vec3 color = texture(texture0, tc/texSize).rgb; finalColor = vec4(color, 1.0);; } \ No newline at end of file