aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gl/texture.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/gl/texture.lisp
parent2cbb8e4114c860e1774efd40d18661aee8ab2a72 (diff)
Replaced defclass-std with defrefactor-with-def
Diffstat (limited to 'src/gl/texture.lisp')
-rw-r--r--src/gl/texture.lisp16
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)))