From caf3fb9aeb3ddc8160dc71c9a871cf4d157ff709 Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Sat, 6 Dec 2025 12:11:58 -0600 Subject: lower opengl requirements from 3.30 core to 3.00 ES --- renderer.py | 8 ++++++-- todo | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/renderer.py b/renderer.py index ae4be12..3d157cb 100644 --- a/renderer.py +++ b/renderer.py @@ -36,7 +36,8 @@ class ImageRenderer: @staticmethod def _init_shader(): vertex_src = """ - #version 330 core + #version 300 es + precision mediump float; // Precision for float variables (mandatory for ES) layout (location = 0) in vec2 aPos; // Vertex position layout (location = 1) in vec2 aTexCoord; // Texture coordinates uniform mat4 uTransform; // Transformation matrix @@ -48,7 +49,8 @@ class ImageRenderer: } """ fragment_src = """ - #version 330 core + #version 300 es + precision mediump float; // Precision for float variables (mandatory for ES) in vec2 TexCoord; // Interpolated texture coordinates out vec4 FragColor; // Final fragment color uniform sampler2D uTexture; // Texture sampler @@ -96,6 +98,8 @@ class ImageRenderer: return vao def draw_image(self, tex, win_w, win_h, alpha): + if not tex.initialized: + return glUseProgram(self.shader) glBindVertexArray(self.vao) # FIXME check if tex.id is None diff --git a/todo b/todo index 0970123..cc1ebd1 100644 --- a/todo +++ b/todo @@ -1,2 +1,3 @@ push current images data on new socket connection opening up decrease size of assets in memory +support older opengl versions e.g. for running on older pi's -- cgit v1.2.3