From: Mikko Rasa Date: Sat, 12 Dec 2015 17:07:18 +0000 (+0200) Subject: Invert the Y coordinate for monitors as well X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=89598f3b919444aa399eb47736f04e2c062c856a;p=geometrycompositor.git Invert the Y coordinate for monitors as well --- diff --git a/source/main.c b/source/main.c index 1aee407..5393784 100644 --- a/source/main.c +++ b/source/main.c @@ -489,7 +489,7 @@ void update_monitor_vertices(CompositedScreen *screen, CompositedMonitor *monito v = vertex_data+(y*(t+1)+x)*4; v[2] = (monitor->x+xf*monitor->width)/screen->width; - v[3] = (monitor->y+yf*monitor->height)/screen->height; + v[3] = ((float)screen->height-monitor->y-monitor->height+yf*monitor->height)/screen->height; z = sqrt(0.25f-(xf-0.5f)*(xf-0.5f)*4.0f*cyl_w_sq)-0.5f+monitor->cylinder_depth; if(monitor->keystone_vertical>0) @@ -1066,7 +1066,7 @@ void refresh_screen(Compositor *compositor, CompositedScreen *screen) continue; glUniform4f(screen->geometry_loc, - (float)monitor->x/screen->width, (float)monitor->y/screen->height, + (float)monitor->x/screen->width, ((float)screen->height-monitor->y-monitor->height)/screen->height, (float)monitor->width/screen->width, (float)monitor->height/screen->height); glBindVertexArray(monitor->vertex_array);