From 8a51ba81c7df6b0b6dab7cf4b35b5ca084b653ba Mon Sep 17 00:00:00 2001 From: colin Date: Tue, 10 Dec 2024 07:11:02 -0800 Subject: Replaced defclass-std with def --- src/interactive/canvas.lisp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/interactive/canvas.lisp') 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)) -- cgit v1.2.3