Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
39 lines (29 sloc) 1.26 KB
#|
This file is a part of trial
(c) 2016 Shirakumo http://tymoon.eu (shinmera@tymoon.eu)
Author: Nicolas Hafner <shinmera@tymoon.eu>
|#
(in-package #:org.shirakumo.fraf.trial)
(defclass pipelined-scene (scene pipeline bakable)
())
(defmethod paint ((scene pipelined-scene) target)
(paint-with scene scene))
(defmethod paint ((scene pipelined-scene) (target shader-pass))
(for:for ((element over scene))
(paint-with target element)))
(defmethod enter :after ((entity entity) (scene pipelined-scene))
(register-object-for-pass scene entity))
(defmethod leave :after ((entity entity) (scene pipelined-scene))
;; FIXME: A system for figuring out when we can GC shader programs
;; (deregister-object-for-pass scene entity)
)
(defmethod bake ((scene pipelined-scene))
(pack-pipeline scene *context*)
(for:for ((element over scene))
(register-object-for-pass scene element)))
(defmethod compute-resources ((scene pipelined-scene) resources readying cache)
(compute-resources (objects scene) resources readying cache)
(compute-resources (textures scene) resources readying cache)
(compute-resources (passes scene) resources readying cache))
(defmethod handle :after ((event resize) (scene pipelined-scene))
(resize scene (width event) (height event)))