diff options
| author | Tim Keller <tjkeller.xyz> | 2025-05-10 15:26:01 -0500 |
|---|---|---|
| committer | Tim Keller <tjkeller.xyz> | 2025-05-10 15:26:01 -0500 |
| commit | b823139687f3c55dd3695e11a0cf8f9693524e9b (patch) | |
| tree | 9104440a9ce180083ad9980f54fc734c0f688dbc | |
| parent | 2bd4da7678b027843cac1a03a1b5f6cc70a7cc81 (diff) | |
| download | immich-frame-b823139687f3c55dd3695e11a0cf8f9693524e9b.tar.xz immich-frame-b823139687f3c55dd3695e11a0cf8f9693524e9b.zip | |
max framerate setter getter
| -rw-r--r-- | window.py | 17 |
1 files changed, 10 insertions, 7 deletions
@@ -17,14 +17,21 @@ class PixDisplay: self.renderer = None self.window_width = 0 self.window_height = 0 - # TODO - self.max_framerate = 60 - self.frame_time = int(1000 / self.max_framerate) # In ms + self.max_framerate = 30 self.display_duration = 2.0 self.transition_duration = 0.5 @property + def max_framerate(self): + return self._max_fps + + @max_framerate.setter + def max_framerate(self, max_fps): + self._max_fps = max_fps # This is just for the getter since otherwise e.g. int(1000/int(1000/60)) would round to 62 + self.frame_time = int(1000 / 60) # In ms + + @property def next_texture_index(self): return (self.current_texture_index + 1) % len(self.textures) @property @@ -44,8 +51,6 @@ class PixDisplay: if not self.textures: glClearColor(0.0, 0.0, 0.0, 1.0) # Set the background color to black glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) - #glLoadIdentity() - glutSwapBuffers() return @@ -65,7 +70,6 @@ class PixDisplay: glClearColor(0.0, 0.0, 0.0, 1.0) # Set the background color to black glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) - #glLoadIdentity() self.renderer.draw_static(self.texture_current, self.window_width, self.window_height, 1) @@ -76,7 +80,6 @@ class PixDisplay: glClearColor(0.0, 0.0, 0.0, 1.0) # Set the background color to black glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) - #glLoadIdentity() # DRAW transition_time = self.image_time - self.display_duration |
