From 2f03f39e24053377dce108e45fde13ccd1e0ae22 Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Tue, 24 Jun 2025 18:56:53 -0500 Subject: window can now handle no selected albums --- window.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'window.py') 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() -- cgit v1.2.3