diff options
| author | hunter@kvog.sh <hunter@kvog.sh> | 2026-02-05 21:17:42 -0600 |
|---|---|---|
| committer | hunter@kvog.sh <hunter@kvog.sh> | 2026-02-05 21:17:42 -0600 |
| commit | 1f80fdb94a34f5c63a354da86347eaef1ca1c248 (patch) | |
| tree | 43c6a78a073d8e72729431d8abdec53d78d225c4 /shaders/subpixel.cc | |
| parent | 45ff70420ad4ffbcaa5e420e3f1327a80e215fb0 (diff) | |
| parent | 9bb07a21660982f5ae809d8e48641699ba3f3b05 (diff) | |
Merge branch 'subpixel'
Diffstat (limited to 'shaders/subpixel.cc')
| -rw-r--r-- | shaders/subpixel.cc | 22 |
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); |