summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Keller <tjk@tjkeller.xyz>2025-12-06 12:11:58 -0600
committerTim Keller <tjk@tjkeller.xyz>2025-12-06 12:11:58 -0600
commitcaf3fb9aeb3ddc8160dc71c9a871cf4d157ff709 (patch)
treea771ec89fb0b132a9d6d031b8c7f145e9cc0e712
parent50282b634d805befbe4b365fd9fb9b0f55edf995 (diff)
downloadimmich-frame-caf3fb9aeb3ddc8160dc71c9a871cf4d157ff709.tar.xz
immich-frame-caf3fb9aeb3ddc8160dc71c9a871cf4d157ff709.zip
lower opengl requirements from 3.30 core to 3.00 ES
-rw-r--r--renderer.py8
-rw-r--r--todo1
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