From 507fee11e36be24f9f58583f0456554cb81ef384 Mon Sep 17 00:00:00 2001 From: Lephe Date: Mon, 5 Jul 2021 22:17:53 +0200 Subject: [PATCH] azur: (minor) --- azur/glsl/vs_tex2d.glsl | 13 +++---------- azur/src/sdl_opengl/init.c | 1 - 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/azur/glsl/vs_tex2d.glsl b/azur/glsl/vs_tex2d.glsl index 952d171..4208eeb 100644 --- a/azur/glsl/vs_tex2d.glsl +++ b/azur/glsl/vs_tex2d.glsl @@ -6,16 +6,9 @@ layout(location=1) in vec2 a_texture_pos; /* Location in image space */ out vec2 v_position; -uniform vec2 u_windowSize; +uniform mat3 u_transform; void main() { - v_position = a_texture_pos; - - float w = u_windowSize.x / 2.0; - float h = u_windowSize.y / 2.0; - - gl_Position.x = (a_vertex.x - w) / w; - gl_Position.y = -(a_vertex.y - h) / h; - gl_Position.z = 0.0; - gl_Position.w = 1.0; + v_position = a_texture_pos; + gl_Position = vec4((u_transform * vec3(a_vertex, 1.0)).xy, 0.0, 1.0); } diff --git a/azur/src/sdl_opengl/init.c b/azur/src/sdl_opengl/init.c index f278124..2e649ce 100644 --- a/azur/src/sdl_opengl/init.c +++ b/azur/src/sdl_opengl/init.c @@ -69,7 +69,6 @@ int azur_init(char const *title, int window_width, int window_height) } #endif - glEnable(GL_SCISSOR_TEST); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);