diff options
| author | Tim Keller <tjk@tjkeller.xyz> | 2025-12-06 12:11:58 -0600 |
|---|---|---|
| committer | Tim Keller <tjk@tjkeller.xyz> | 2025-12-06 12:11:58 -0600 |
| commit | caf3fb9aeb3ddc8160dc71c9a871cf4d157ff709 (patch) | |
| tree | a771ec89fb0b132a9d6d031b8c7f145e9cc0e712 /renderer.py | |
| parent | 50282b634d805befbe4b365fd9fb9b0f55edf995 (diff) | |
| download | immich-frame-caf3fb9aeb3ddc8160dc71c9a871cf4d157ff709.tar.xz immich-frame-caf3fb9aeb3ddc8160dc71c9a871cf4d157ff709.zip | |
lower opengl requirements from 3.30 core to 3.00 ES
Diffstat (limited to 'renderer.py')
| -rw-r--r-- | renderer.py | 8 |
1 files changed, 6 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 |
