diff options
author | colin <colin@cicadas.surf> | 2024-12-14 08:36:23 -0800 |
---|---|---|
committer | colin <colin@cicadas.surf> | 2024-12-14 08:36:23 -0800 |
commit | 3a2217263d581be9a7f629b10d75aa8e3d581890 (patch) | |
tree | 23f5f0a5449a06473aba2ec7914a3c2193823a10 /src/gl | |
parent | 03cdbb6a15e130a012377ab8d54074b6864e3480 (diff) | |
parent | 8a51ba81c7df6b0b6dab7cf4b35b5ca084b653ba (diff) |
Merge branch 'refactor-with-def'
Diffstat (limited to 'src/gl')
-rw-r--r-- | src/gl/texture.lisp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/gl/texture.lisp b/src/gl/texture.lisp index 0aa698f..2b555a6 100644 --- a/src/gl/texture.lisp +++ b/src/gl/texture.lisp @@ -2,11 +2,17 @@ (in-package #:wheelwork) -(defclass/std texture () - ((width height id mipmap :with :r :i) - (internal-format image-format :ri :with :std :rgba) - (wrap-s wrap-t :ri :with :std :repeat) - (min-filter mag-filter :ri :with :std :nearest))) +;; TODO: make deftypes for keyword valued slots +(def:class texture () + (width height :prefix :ro :type float) + ((id "Texture id assigned by gl:gen-texture") + :prefix :ro :type (unsigned-byte 32)) + ((mipmap "Whether to generate mipmap") + :prefix :ro :type boolean :initform nil) + (internal-format image-format :ro :prefix :type keyword :initform :rgba) + (wrap-s wrap-t :prefix :ro :type keyword :initform :repeat) + (min-filter mag-filter :prefix :ro :type keyword :initform :nearest)) + (defmethod cleanup ((texture texture)) (gl:delete-texture (texture-id texture))) |