From fa075766cc4455a7ac8a711bfa9b666f3f6ced99 Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Tue, 22 Jan 2019 17:48:49 -0800 Subject: [PATCH] fix y inversion. camera now feels totally correct --- docs/TODO_ux.md | 6 ++++-- ezgui/src/vertex.glsl | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/TODO_ux.md b/docs/TODO_ux.md index ab43315747..3c546c8221 100644 --- a/docs/TODO_ux.md +++ b/docs/TODO_ux.md @@ -66,9 +66,11 @@ ## Switch to OpenGL (for speed) - get things running again - - simplify camera math drastically - - render text - calling draw way too frequently + - circles, arrows, other disabled things + - forking + - render text - change ezgui API to allow uploading geometry once - undo the y inversion hacks at last! +- probably use f32, not f64 everywhere diff --git a/ezgui/src/vertex.glsl b/ezgui/src/vertex.glsl index 20a4cd78cc..d2686628fd 100644 --- a/ezgui/src/vertex.glsl +++ b/ezgui/src/vertex.glsl @@ -18,5 +18,6 @@ void main() { // Translate that to clip-space or whatever it's called float x = (screen_x / window[0] * 2.0) - 1; float y = (screen_y / window[1] * 2.0) - 1; - gl_Position = vec4(x, y, 0.0, 1.0); + // Note the y inversion + gl_Position = vec4(x, -y, 0.0, 1.0); }