From 574302ed0fced0d57233c4517d414b4c3e875d7d Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 13 Dec 2015 14:12:44 +0200 Subject: [PATCH] Simplify some formulas a bit --- source/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/main.c b/source/main.c index 08be9dd..1cabcf6 100644 --- a/source/main.c +++ b/source/main.c @@ -1072,7 +1072,7 @@ void refresh_screen(Compositor *compositor, CompositedScreen *screen) glBindTexture(GL_TEXTURE_2D, window->texture); compositor->glXBindTexImageEXT(compositor->display, window->glx_pixmap, GLX_FRONT_LEFT_EXT, NULL); glUniform4f(screen->geometry_loc, - (float)window->x/screen->width, ((float)screen->height-window->y-window->height)/screen->height, + (float)window->x/screen->width, 1.0f-(float)(window->y+window->height)/screen->height, (float)(window->width+2*window->border)/screen->width, (float)(window->height+2*window->border)/screen->height); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); compositor->glXReleaseTexImageEXT(compositor->display, window->glx_pixmap, GLX_FRONT_LEFT_EXT); @@ -1093,7 +1093,7 @@ void refresh_screen(Compositor *compositor, CompositedScreen *screen) continue; glUniform4f(screen->geometry_loc, - (float)monitor->x/screen->width, ((float)screen->height-monitor->y-monitor->height)/screen->height, + (float)monitor->x/screen->width, 1.0f-(float)(monitor->y+monitor->height)/screen->height, (float)monitor->width/screen->width, (float)monitor->height/screen->height); glBindVertexArray(monitor->vertex_array); -- 2.45.2