]> git.jsancho.org Git - gacela.git/blobdiff - gacela/image.scm
Scale support variations over time
[gacela.git] / gacela / image.scm
index 2af2b4b732ab98685fe349488b4ecb0bcf01a749..236ac744fd420e83bf770e606346c46c02cf0d3a 100644 (file)
@@ -47,6 +47,9 @@
          (set! h/2 (/ (sdl2:surface-height image) 2)))
        (gl-enable (oes-framebuffer-object texture-2d))
        (sdl2:bind-texture texture)
+       (gl-enable (oes-framebuffer-object blend))
+       (set-gl-blend-function (blending-factor-src src-alpha)
+                              (blending-factor-dest one-minus-src-alpha))
        (gl-begin (begin-mode quads)
          (gl-texture-coordinates 0 0)
          (gl-vertex (- w/2) h/2 0)
@@ -56,6 +59,7 @@
          (gl-vertex w/2 (- h/2) 0)
          (gl-texture-coordinates 0 1)
          (gl-vertex (- w/2) (- h/2) 0))
+       (gl-disable (oes-framebuffer-object blend))
        (gl-disable (oes-framebuffer-object texture-2d))))))
 
 (define* (move scene x y #:optional (z 0))
@@ -71,7 +75,9 @@
   (make-scene
    "scale"
    (lambda ()
-     (gl-scale x y z)
+     (gl-scale (calculate x)
+               (calculate y)
+               (calculate z))
      (display-scene scene))))
 
 (define (over . scenes)