summaryrefslogtreecommitdiff
path: root/window.py
diff options
context:
space:
mode:
Diffstat (limited to 'window.py')
-rw-r--r--window.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/window.py b/window.py
index 4c51bd1..e3c9fa2 100644
--- a/window.py
+++ b/window.py
@@ -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