forked from Shirakumo/trial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pipelined-scene.lisp
37 lines (28 loc) · 1.11 KB
/
pipelined-scene.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#|
This file is a part of trial
(c) 2016 Shirakumo http://tymoon.eu ([email protected])
Author: Nicolas Hafner <[email protected]>
|#
(in-package #:org.shirakumo.fraf.trial)
(defclass pipelined-scene (scene pipeline)
())
(defmethod leave :after ((entity entity) (scene pipelined-scene))
;; FIXME: A system for figuring out when we can GC shader programs
)
(defmethod setup-scene :after (main (scene scene))
(pack-pipeline scene (context main)))
(defmethod stage :before ((scene pipelined-scene) (area staging-area))
(compile-to-pass scene scene))
(defmethod stage :after ((scene pipelined-scene) (area staging-area))
(loop for texture across (textures scene)
do (stage texture area))
(loop for pass across (passes scene)
do (stage pass area)))
(defmethod handle :after ((event resize) (scene pipelined-scene))
(resize scene (width event) (height event)))
(defmethod enter* ((thing entity) (scene pipelined-scene))
(compile-into-pass thing scene scene)
(enter thing scene))
(defmethod leave* ((thing entity) (scene pipelined-scene))
(leave thing scene)
(remove-from-pass thing scene))