summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2015-09-09 08:51:56 -0400
committerDavid Thompson <dthompson2@worcester.edu>2015-09-09 08:59:43 -0400
commit7ef2178ca853cde6fb376a9d35cadcaac402ba99 (patch)
treeb3aaa7286553c03264666e947d8b04922d73ec90
parentf8b48b550d5f167483a545f207ae053d8fa9d5dd (diff)
render: Reset OpenGL state after drawing a frame.
Not resetting the graphics context after rendering leads to strange bugs such as sprites disappearing when a new mesh is created in between drawing. * sly/render.scm (with-graphics): Reset context after drawing.
-rw-r--r--sly/render.scm5
1 files changed, 4 insertions, 1 deletions
diff --git a/sly/render.scm b/sly/render.scm
index 15103cd..bc6db6b 100644
--- a/sly/render.scm
+++ b/sly/render.scm
@@ -175,7 +175,10 @@
(stack-transform-identity! (graphics-model-view gfx)))
(define-syntax-rule (with-graphics gfx body ...)
- (begin (graphics-reset! gfx) body ...))
+ (begin
+ (graphics-reset! gfx)
+ body ...
+ (graphics-reset! gfx)))
(define (graphics-transform gfx)
(q-front (graphics-model-view gfx)))