summaryrefslogtreecommitdiff
path: root/window.py
diff options
context:
space:
mode:
Diffstat (limited to 'window.py')
-rw-r--r--window.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/window.py b/window.py
index 0bb5b3d..5387930 100644
--- a/window.py
+++ b/window.py
@@ -35,6 +35,10 @@ class PixDisplay:
self.transition_duration = config.transition_duration
self.auto_transition = config.auto_transition
+ def update_textures(self, textures):
+ self.textures = textures
+ self.current_texture_index = 0
+
@property
def max_framerate(self):
#return int(1000/int(1000/self.frame_time))
@@ -68,9 +72,10 @@ class PixDisplay:
self.last_time = current_time
if not self.tex or not self.tex.initialized or not self.tex.id:
- self.increment_texture_index(0)
+ if self.textures.asset_count > 0:
+ self.increment_texture_index(0)
# Draw black window if no textures are available
- if not self.tex.id:
+ if not self.tex or not self.tex.id:
glClearColor(0.0, 0.0, 0.0, 1.0)
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
glutSwapBuffers()