summaryrefslogtreecommitdiff
path: root/Source/3rdParty/SDL2/src/render/opengles2/SDL_shaders_gles2.c
diff options
context:
space:
mode:
Diffstat (limited to 'Source/3rdParty/SDL2/src/render/opengles2/SDL_shaders_gles2.c')
-rw-r--r--Source/3rdParty/SDL2/src/render/opengles2/SDL_shaders_gles2.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/Source/3rdParty/SDL2/src/render/opengles2/SDL_shaders_gles2.c b/Source/3rdParty/SDL2/src/render/opengles2/SDL_shaders_gles2.c
index b0bcdff..f428a49 100644
--- a/Source/3rdParty/SDL2/src/render/opengles2/SDL_shaders_gles2.c
+++ b/Source/3rdParty/SDL2/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; \