diff options
Diffstat (limited to 'src/interactive/canvas.lisp')
-rw-r--r-- | src/interactive/canvas.lisp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/interactive/canvas.lisp b/src/interactive/canvas.lisp index af54634..f4b2b74 100644 --- a/src/interactive/canvas.lisp +++ b/src/interactive/canvas.lisp @@ -2,9 +2,11 @@ (in-package #:wheelwork) -(defclass/std pixels () - ((pixel-width pixel-height :std (error "pixel-width and pixel-height are required")) - (data :a :with :doc "Array of RGBA data representing an image of pixel-width X pixel-height"))) +(def:class pixels () + (pixel-width pixel-height :required :type fixnum) + (data :prefix + :type (vector (unsigned-byte 8)) + :documentation "Array of RGBA data")) (defmethod initialize-instance :after ((pixels pixels) &key) (with-slots (pixel-width pixel-height data) pixels @@ -145,14 +147,15 @@ e.g., drawing a line in a particular color." (gl:delete-vertex-arrays (list *canvas-render-vao*))) (when *canvas-shader-program* (gl:delete-program *canvas-shader-program*)) - (setf-many *canvas-fbo-vao* - *canvas-render-vao* + (setf-many *canvas-render-vao* *canvas-shader-program* nil))))) -(defclass/std canvas (unit interactive pixels) - ((fbo :with :r :doc "framebuffer object for use in off-screen-rendering of this canvas to a texture") - (texture :with :a :doc "texture instance"))) +(def:class canvas (unit interactive pixels) + ((fbo "framebuffer object for use in off-screen rendering of this canvas to a texture") + :prefix :ro) + ((texture "the texture where the pixles are rendered") + :prefix)) (defmethod cleanup ((canvas canvas)) (cleanup (canvas-texture canvas)) |