summaryrefslogtreecommitdiff
path: root/shaders/subpixel.cc
diff options
context:
space:
mode:
Diffstat (limited to 'shaders/subpixel.cc')
-rw-r--r--shaders/subpixel.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/shaders/subpixel.cc b/shaders/subpixel.cc
new file mode 100644
index 0000000..73a5d51
--- /dev/null
+++ b/shaders/subpixel.cc
@@ -0,0 +1,22 @@
+#include "shaders.hh"
+
+static float u_quad[2] = { 256.0f, 2.0f };
+
+static void ui()
+{
+ ImGui::SliderFloat("quad width", &u_quad[0], 1.0f, 512.0f);
+ ImGui::SliderFloat("quad height", &u_quad[1], 1.0f, 512.0f);
+}
+
+static void uniforms(Shader* shader)
+{
+ GL(glUniform2fv(shader->get_required_uniform("u_quad"), 1, u_quad));
+}
+
+static Shader subpixel = {
+ .path = "subpixel.glsl",
+ .model = MODEL_QUAD,
+ .ui_fn = ui,
+ .uf_fn = uniforms,
+};
+ENABLE_SHADER(subpixel);