diff options
author | David Thompson <dthompson2@worcester.edu> | 2015-09-21 19:44:10 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2015-09-21 19:48:44 -0400 |
commit | 46544b7dba0081f22e686f70c606a338c7fa52dd (patch) | |
tree | 9688f43493606f7b0e4da8784a7804cc32f128eb /examples/simple.scm | |
parent | b7bf25020f146331d161d86ef30df31d2959a8dc (diff) |
render: Reimplement rendering engine using functional combinators.
Warning: This is a huge commit.
I completely gutted the old scene graph and replaced it with a somewhat
monadic rendering combinator module instead. The interface remains
purely functional, but replaces the <model> data type with procedures in
the rendering monad instead. This opens the door for
rendering *anything*, not just meshes. Now I can implement particle
systems and other non-static things.
Diffstat (limited to 'examples/simple.scm')
-rw-r--r-- | examples/simple.scm | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/examples/simple.scm b/examples/simple.scm index e4de293..0f3760b 100644 --- a/examples/simple.scm +++ b/examples/simple.scm @@ -1,5 +1,5 @@ ;;; Sly -;;; Copyright (C) 2013, 2014 David Thompson <dthompson2@worcester.edu> +;;; Copyright (C) 2013, 2014, 2015 David Thompson <dthompson2@worcester.edu> ;;; ;;; This program is free software: you can redistribute it and/or ;;; modify it under the terms of the GNU General Public License as @@ -19,22 +19,23 @@ (sly window) (sly utils) (sly signal) + (sly math rect) (sly math vector) + (sly render) (sly render camera) - (sly render model) - (sly render sprite) (sly render color) - (sly render scene)) + (sly render shader) + (sly render sprite) + (sly render texture)) (load "common.scm") -(define model - (model-move (vector2 320 240) - (load-sprite "images/p1_front.png"))) - -(define camera (orthographic-camera 640 480)) +(define sprite (load-sprite "images/p1_front.png")) -(define-signal scene (make-scene camera model)) +(define-signal scene + (with-camera (2d-camera #:area (make-rect 0 0 640 480)) + (move (vector2 320 240) + (render-sprite sprite)))) (with-window (make-window #:title "Simple Sprite Demo") (run-game-loop scene)) |