diff options
Diffstat (limited to 'chickadee/render/sprite.scm')
-rw-r--r-- | chickadee/render/sprite.scm | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/chickadee/render/sprite.scm b/chickadee/render/sprite.scm index 144c656..a5c25bc 100644 --- a/chickadee/render/sprite.scm +++ b/chickadee/render/sprite.scm @@ -55,8 +55,15 @@ layout (location = 1) in vec2 tex; #elif ifdef GLSL130 in vec2 position; in vec2 tex; +#elif ifdef GLSL120 +attribute vec2 position; +attribute vec2 tex; #endif +#ifdef GLSL120 +varying vec2 fragTex; +#else out vec2 fragTex; +#endif uniform mat4 mvp; void main(void) { @@ -66,7 +73,11 @@ void main(void) { " " +#ifdef GLSL120 +attribute vec2 fragTex; +#else in vec2 fragTex; +#endif #ifdef GLSL330 out vec4 fragColor; #endif @@ -76,7 +87,7 @@ uniform vec4 tint; void main (void) { #ifdef GLSL330 fragColor = texture(colorTexture, fragTex) * tint; -#elif ifdef GLSL130 +#else gl_FragColor = texture2D(colorTexture, fragTex) * tint; #endif } @@ -393,13 +404,22 @@ may be specified via the TEXTURE-REGION argument." layout (location = 0) in vec2 position; layout (location = 1) in vec2 tex; layout (location = 2) in vec4 tint; -#elif ifdef GLSL130 +#elif defined(GLSL130) in vec2 position; in vec2 tex; in vec4 tint; +#elif defined(GLSL120) +attribute vec2 position; +attribute vec2 tex; +attribute vec4 tint; #endif +#ifdef GLSL120 +varying vec2 fragTex; +varying vec2 fragTint; +#else out vec2 fragTex; out vec4 fragTint; +#endif uniform mat4 mvp; void main(void) { @@ -409,8 +429,13 @@ void main(void) { } " " +#ifdef GLSL120 +attribute vec2 fragTex; +attribute vec4 fragTint; +#else in vec2 fragTex; in vec4 fragTint; +#endif #ifdef GLSL330 out vec4 fragColor; #endif @@ -419,7 +444,7 @@ uniform sampler2D colorTexture; void main (void) { #ifdef GLSL330 fragColor = texture(colorTexture, fragTex) * fragTint; -#elif ifdef GLSL130 +#else gl_FragColor = texture2D(colorTexture, fragTex) * fragTint; #endif } |