summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chickadee/graphics/engine.scm9
1 files changed, 8 insertions, 1 deletions
diff --git a/chickadee/graphics/engine.scm b/chickadee/graphics/engine.scm
index 1531e3f..631f792 100644
--- a/chickadee/graphics/engine.scm
+++ b/chickadee/graphics/engine.scm
@@ -3,6 +3,7 @@
#:use-module (chickadee math matrix)
#:use-module (gl)
#:use-module (ice-9 atomic)
+ #:use-module (ice-9 format)
#:use-module (ice-9 match)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-9)
@@ -232,7 +233,13 @@
(define* (graphics-engine-state-ref name #:optional
(engine (current-graphics-engine)))
- (graphics-state-ref (hashq-ref (graphics-engine-states engine) name)))
+ (let ((state (hashq-ref (graphics-engine-states engine) name)))
+ (if state
+ (graphics-state-ref state)
+ (error
+ (format #f
+ "No such graphics state '~a'. Did you include the module that defines it?"
+ name)))))
(define* (graphics-engine-state-set! name value #:optional
(engine (current-graphics-engine)))