From 9bb07a21660982f5ae809d8e48641699ba3f3b05 Mon Sep 17 00:00:00 2001 From: "hunter@kvog.sh" Date: Thu, 5 Feb 2026 21:17:07 -0600 Subject: shaders/subpixel --- shaders/subpixel.cc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 shaders/subpixel.cc (limited to 'shaders/subpixel.cc') 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); -- cgit v1.2.3