summaryrefslogtreecommitdiff
path: root/chickadee/graphics/blend.scm
diff options
context:
space:
mode:
Diffstat (limited to 'chickadee/graphics/blend.scm')
-rw-r--r--chickadee/graphics/blend.scm13
1 files changed, 9 insertions, 4 deletions
diff --git a/chickadee/graphics/blend.scm b/chickadee/graphics/blend.scm
index 465a449..a189210 100644
--- a/chickadee/graphics/blend.scm
+++ b/chickadee/graphics/blend.scm
@@ -1,5 +1,5 @@
;;; Chickadee Game Toolkit
-;;; Copyright © 2016 David Thompson <davet@gnu.org>
+;;; Copyright © 2016, 2021 David Thompson <davet@gnu.org>
;;;
;;; Chickadee is free software: you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published
@@ -18,11 +18,11 @@
(define-module (chickadee graphics blend)
#:use-module (ice-9 match)
#:use-module (gl)
+ #:use-module (chickadee graphics engine)
#:use-module (chickadee graphics gl)
- #:use-module (chickadee graphics gpu)
- #:export (apply-blend-mode))
+ #:export (current-blend-mode))
-(define (apply-blend-mode blend-mode)
+(define (bind-blend-mode blend-mode)
(if blend-mode
(begin
(gl-enable (enable-cap blend))
@@ -61,3 +61,8 @@
(gl-blend-func (blending-factor-src one)
(blending-factor-dest zero)))))
(gl-disable (enable-cap blend))))
+
+(define-graphics-state blend-mode
+ current-blend-mode
+ #:default 'replace
+ #:bind bind-blend-mode)