From: Javier Sancho Date: Mon, 24 Apr 2017 15:59:15 +0000 (+0200) Subject: Enable transparency X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=7fb1ff434787d12f8e4111a44dfc684a0b94eac3;p=gacela.git Enable transparency --- diff --git a/gacela/image.scm b/gacela/image.scm index 2af2b4b..6acff1d 100644 --- a/gacela/image.scm +++ b/gacela/image.scm @@ -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))