summaryrefslogtreecommitdiff
path: root/test-subject/common.scm
diff options
context:
space:
mode:
Diffstat (limited to 'test-subject/common.scm')
-rw-r--r--test-subject/common.scm24
1 files changed, 24 insertions, 0 deletions
diff --git a/test-subject/common.scm b/test-subject/common.scm
new file mode 100644
index 0000000..9e756b3
--- /dev/null
+++ b/test-subject/common.scm
@@ -0,0 +1,24 @@
+(define-module (test-subject common)
+ #:use-module (chickadee graphics color)
+ #:use-module (chickadee graphics viewport)
+ #:use-module (chickadee math vector)
+ #:use-module (oop goops)
+ #:use-module (starling node-2d)
+ #:use-module (starling scene)
+ #:export (%window-width
+ %window-height
+ %game-width
+ %game-height
+ set-cameras!))
+
+(define %window-width 1280)
+(define %window-height 720)
+(define %game-width 640)
+(define %game-height 360)
+
+(define-method (set-cameras! (scene <scene-2d>))
+ (set! (cameras scene)
+ (list (make <camera-2d>
+ #:resolution (vec2 %game-width %game-height)
+ #:viewport (make-viewport 0 0 %window-width %window-height
+ #:clear-color black)))))