]> git.sesse.net Git - movit/blobdiff - flat_input.frag
Make Input an abstract base class, and move the current functionality into FlatInput...
[movit] / flat_input.frag
diff --git a/flat_input.frag b/flat_input.frag
new file mode 100644 (file)
index 0000000..4bc055e
--- /dev/null
@@ -0,0 +1,10 @@
+uniform sampler2D PREFIX(tex);
+
+vec4 FUNCNAME(vec2 tc) {
+       // OpenGL's origin is bottom-left, but most graphics software assumes
+       // a top-left origin. Thus, for inputs that come from the user,
+       // we flip the y coordinate.
+       tc.y = 1.0f - tc.y;
+
+       return texture2D(PREFIX(tex), tc);
+}