diff options
author | David Thompson <dthompson2@worcester.edu> | 2016-02-15 14:52:03 -0500 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2016-02-15 14:52:03 -0500 |
commit | 0de5247b7653394bf9ceecfc17d188dab3c7bcd5 (patch) | |
tree | 6ef8d323c32ed62bbdd90ea72f541e414c848d25 /sly/game.scm | |
parent | 000315b8f5e2cfe45db0ebfe42f9208c9c0d95e1 (diff) |
Use a single foreign object guardian.
Rather than each foreign resource type creating its own guardian, let's
just use one instead so that there is only a single guardian to talk to
each frame.
* sly/guardian.scm: New file.
* Makefile.am (SOURCES): Add it.
* sly/game.scm (run-game-loop): Start guardian worker.
* sly/render/mesh.scm (mesh-guardian): Delete.
(free-mesh): New procedure.
(make-mesh): Guard newly created meshes.
* sly/render/shader.scm (shader-stage-guardian): Delete.
(free-shader-stage): New procedure.
(make-shader-stage): Guard newly created shader stages.
(shader-guardian): Delete.
(free-shader): New procedure.
(make-shader): Guard newly created shaders.
* sly/render/texture.scm (texture-guardian): Delete.
(free-texture): New procedure.
(make-texture): Guard newly created textures.
Diffstat (limited to 'sly/game.scm')
-rw-r--r-- | sly/game.scm | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sly/game.scm b/sly/game.scm index 38d230e..66f0893 100644 --- a/sly/game.scm +++ b/sly/game.scm @@ -31,6 +31,7 @@ #:use-module (gl) #:use-module (sly agenda) #:use-module (sly event) + #:use-module (sly guardian) #:use-module (sly math) #:use-module (sly signal) #:use-module (sly math vector) @@ -184,6 +185,7 @@ milliseconds of the last iteration of the game loop." (stop-game-loop))) ;; Let's play! (run-hook game-start-hook) + (run-guardian) (game-loop (sdl-ticks) 0)) (lambda (cont callback) (when (procedure? callback) |