summaryrefslogtreecommitdiff
path: root/transition.py
diff options
context:
space:
mode:
Diffstat (limited to 'transition.py')
-rw-r--r--transition.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/transition.py b/transition.py
index cf2acb4..a076889 100644
--- a/transition.py
+++ b/transition.py
@@ -10,25 +10,25 @@ class Transition:
alpha = 1.0
# Draw the first image
- self._draw_image(texture_prev, 3840, 2160, window_width, window_height, 1 - alpha) # TODO instead of decreasing alpha, draw transparent letterboxes
+ self.draw_image(texture_prev, window_width, window_height, 1 - alpha) # TODO instead of decreasing alpha, draw transparent letterboxes
# Draw the second image (with transparency)
- self._draw_image(texture_next, 3840, 2160, window_width, window_height, alpha)
+ self.draw_image(texture_next, window_width, window_height, alpha)
return alpha >= 1.0 # Complete
# Draw the image with blending enabled (to allow fade effect)
- def _draw_image(self, texture_id, img_width, img_height, window_width, window_height, alpha):
- if (not alpha): return
+ def draw_image(self, texture, window_width, window_height, alpha):
+ if not alpha: return
glEnable(GL_BLEND)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
- glBindTexture(GL_TEXTURE_2D, texture_id)
+ glBindTexture(GL_TEXTURE_2D, texture.id)
glColor4f(1.0, 1.0, 1.0, alpha) # Set alpha to control transparency
# Calculate aspect ratio
- img_aspect = img_width / float(img_height)
+ img_aspect = texture.width / float(texture.height)
win_aspect = window_width / float(window_height)
scaled_width = window_width