From b62bbb78ed1ddf1b0cd7af150c715d440e78265e Mon Sep 17 00:00:00 2001 From: Chris Hemingway Date: Fri, 13 May 2016 23:01:48 +0100 Subject: Fix building examples on OSX --- examples/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'examples') 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 -- cgit v1.2.3 From 0e29aa2951fe11e9d0fabec2182ed6309fce37bb Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 17 May 2016 00:39:56 +0200 Subject: 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(-) (limited to 'examples') 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 -- cgit v1.2.3 From bc08271da3e68d2880f4ef712c13e88b99f1021d Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 18 May 2016 12:04:27 +0200 Subject: Updated shaders with comments --- examples/resources/shaders/glsl100/bloom.fs | 2 +- examples/resources/shaders/glsl100/swirl.fs | 2 +- examples/resources/shaders/glsl330/bloom.fs | 2 +- examples/resources/shaders/glsl330/phong.fs | 3 +++ examples/resources/shaders/glsl330/swirl.fs | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) (limited to 'examples') diff --git a/examples/resources/shaders/glsl100/bloom.fs b/examples/resources/shaders/glsl100/bloom.fs index 5a08843d..280d2fb6 100644 --- a/examples/resources/shaders/glsl100/bloom.fs +++ b/examples/resources/shaders/glsl100/bloom.fs @@ -33,5 +33,5 @@ void main() else if (texelColor.r < 0.5) tc = sum*sum*0.009 + texelColor; else tc = sum*sum*0.0075 + texelColor; - finalColor = tc; + gl_FragColor = tc; } \ No newline at end of file diff --git a/examples/resources/shaders/glsl100/swirl.fs b/examples/resources/shaders/glsl100/swirl.fs index e77d4f87..0d6d24f2 100644 --- a/examples/resources/shaders/glsl100/swirl.fs +++ b/examples/resources/shaders/glsl100/swirl.fs @@ -20,7 +20,7 @@ float angle = 0.8; uniform vec2 center = vec2(200.0, 200.0); -void main (void) +void main() { vec2 texSize = vec2(renderWidth, renderHeight); vec2 tc = fragTexCoord*texSize; diff --git a/examples/resources/shaders/glsl330/bloom.fs b/examples/resources/shaders/glsl330/bloom.fs index 47ddee30..0307bc06 100644 --- a/examples/resources/shaders/glsl330/bloom.fs +++ b/examples/resources/shaders/glsl330/bloom.fs @@ -17,7 +17,7 @@ void main() { vec4 sum = vec4(0); vec4 tc = vec4(0); - + for (int i = -4; i < 4; i++) { for (int j = -3; j < 3; j++) diff --git a/examples/resources/shaders/glsl330/phong.fs b/examples/resources/shaders/glsl330/phong.fs index 80e3d673..c14b346a 100644 --- a/examples/resources/shaders/glsl330/phong.fs +++ b/examples/resources/shaders/glsl330/phong.fs @@ -29,6 +29,9 @@ uniform float matGlossiness = 50.0; uniform vec3 lightPosition; uniform vec3 cameraPosition; +// Fragment shader output data +out vec4 fragColor; + // Calculate ambient lighting component vec3 AmbientLighting() { diff --git a/examples/resources/shaders/glsl330/swirl.fs b/examples/resources/shaders/glsl330/swirl.fs index da098754..80c16cc9 100644 --- a/examples/resources/shaders/glsl330/swirl.fs +++ b/examples/resources/shaders/glsl330/swirl.fs @@ -21,7 +21,7 @@ float angle = 0.8; uniform vec2 center = vec2(200.0, 200.0); -void main (void) +void main() { vec2 texSize = vec2(renderWidth, renderHeight); vec2 tc = fragTexCoord*texSize; -- cgit v1.2.3