aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/interactive/canvas.lisp
diff options
context:
space:
mode:
authorcolin <colin@cicadas.surf>2024-12-10 07:11:02 -0800
committercolin <colin@cicadas.surf>2024-12-14 08:35:58 -0800
commit8a51ba81c7df6b0b6dab7cf4b35b5ca084b653ba (patch)
tree23f5f0a5449a06473aba2ec7914a3c2193823a10 /src/interactive/canvas.lisp
parent2cbb8e4114c860e1774efd40d18661aee8ab2a72 (diff)
Replaced defclass-std with defrefactor-with-def
Diffstat (limited to 'src/interactive/canvas.lisp')
-rw-r--r--src/interactive/canvas.lisp19
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))