diff options
Diffstat (limited to 'src/assets')
-rw-r--r-- | src/assets/asset.lisp | 7 | ||||
-rw-r--r-- | src/assets/font.lisp | 11 | ||||
-rw-r--r-- | src/assets/png.lisp | 3 |
3 files changed, 13 insertions, 8 deletions
diff --git a/src/assets/asset.lisp b/src/assets/asset.lisp index 5f847da..e1b4f57 100644 --- a/src/assets/asset.lisp +++ b/src/assets/asset.lisp @@ -2,9 +2,10 @@ (in-package #:wheelwork) -(defclass/std asset () - ((path :with :ri :std (error "An asset requires a path")) - (loadedp :with :a))) +(def:class asset () + ((path "Path to asset") :required :ro :prefix + :type (or pathname string)) + (loadedp :prefix :type boolean :initform nil)) (defmethod cleanup :around ((asset asset)) (when (asset-loadedp asset) diff --git a/src/assets/font.lisp b/src/assets/font.lisp index 3ff29d5..3017572 100644 --- a/src/assets/font.lisp +++ b/src/assets/font.lisp @@ -6,10 +6,13 @@ " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890\".,!?-'" ) -(defclass/std font (asset) - ((characters :i :std +standard-font-chars+) - (oversample :i :doc "ovesampling factor to pass to cl-fond:make-font") - (object :with :r :doc "The font as returned from cl-fond:make-font"))) +(def:class font (asset) + ((characters "The characters renderable with this font") + :prefix :type string :initform +standard-font-chars+) + ((oversample "Oversampling factor") + :prefix :type (or null number) :initform nil) + ((object "Stored font returned by cl-fond") + :prefix :ro :type cl-fond::font)) (defmethod ensure-loaded ((font font)) (with-slots (path characters oversample object) font diff --git a/src/assets/png.lisp b/src/assets/png.lisp index aa259f0..4408d02 100644 --- a/src/assets/png.lisp +++ b/src/assets/png.lisp @@ -2,7 +2,7 @@ (in-package #:wheelwork) -(defclass/std png (asset texture) ()) +(def:class png (asset texture)) (defmethod ensure-loaded ((png png)) (with-slots @@ -27,5 +27,6 @@ :unsigned-byte (pngload:data data)) (gl:bind-texture :texture-2d 0) + ;; what does this do? (when (texture-mipmap png) (gl:generate-mipmap :texture-2d))))) |