From 9cd2e9ec8fc0127393dfce9c0359d500c8c238be Mon Sep 17 00:00:00 2001
From: Edward Rudd <urkle@outoforder.cc>
Date: Tue, 09 Apr 2019 02:22:50 +0000
Subject: [PATCH] updae source to 2.0.9 source
---
source/src/render/opengles2/SDL_shaders_gles2.c | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/source/src/render/opengles2/SDL_shaders_gles2.c b/source/src/render/opengles2/SDL_shaders_gles2.c
index b0bcdff..f428a49 100644
--- a/source/src/render/opengles2/SDL_shaders_gles2.c
+++ b/source/src/render/opengles2/SDL_shaders_gles2.c
@@ -30,20 +30,24 @@
/*************************************************************************************************
* Vertex/fragment shader source *
*************************************************************************************************/
-
+/* Notes on a_angle:
+ * It is a vector containing sin and cos for rotation matrix
+ * To get correct rotation for most cases when a_angle is disabled cos
+ value is decremented by 1.0 to get proper output with 0.0 which is
+ default value
+*/
static const Uint8 GLES2_VertexSrc_Default_[] = " \
uniform mat4 u_projection; \
attribute vec2 a_position; \
attribute vec2 a_texCoord; \
- attribute float a_angle; \
+ attribute vec2 a_angle; \
attribute vec2 a_center; \
varying vec2 v_texCoord; \
\
void main() \
{ \
- float angle = radians(a_angle); \
- float c = cos(angle); \
- float s = sin(angle); \
+ float s = a_angle[0]; \
+ float c = a_angle[1] + 1.0; \
mat2 rotationMatrix = mat2(c, -s, s, c); \
vec2 position = rotationMatrix * (a_position - a_center) + a_center; \
v_texCoord = a_texCoord; \
--
Gitblit v1.9.3