summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2017-10-17 21:39:57 -0400
committerDavid Thompson <dthompson2@worcester.edu>2017-10-17 21:39:57 -0400
commitc7d382fd2ddec2406d7672dd9b082b0e27d7df3c (patch)
tree40c16ed36cff8d0b42df64451dc651d14ba09785
parentc8457c8c8a0341d9a89cfd13038c48f74c479c95 (diff)
render: texture: Add private gl-size field.
* chickadee/render/texture.scm (<texture>)[gl-size]: New field. (null-texture, make-texture): Add gl-size argument.
-rw-r--r--chickadee/render/texture.scm11
1 files changed, 7 insertions, 4 deletions
diff --git a/chickadee/render/texture.scm b/chickadee/render/texture.scm
index c37fef9..2b4755e 100644
--- a/chickadee/render/texture.scm
+++ b/chickadee/render/texture.scm
@@ -71,7 +71,7 @@
;; The <texture> object is a simple wrapper around an OpenGL texture
;; id.
(define-record-type <texture>
- (%make-texture id width height min-filter mag-filter wrap-s wrap-t)
+ (%make-texture id width height min-filter mag-filter wrap-s wrap-t gl-size)
texture?
(id texture-id)
(width texture-width)
@@ -79,7 +79,8 @@
(min-filter texture-min-filter)
(mag-filter texture-mag-filter)
(wrap-s texture-wrap-s)
- (wrap-t texture-wrap-t))
+ (wrap-t texture-wrap-t)
+ (gl-size texture-gl-size))
(set-record-type-printer! <texture>
(lambda (texture port)
@@ -92,7 +93,8 @@
(texture-wrap-s texture)
(texture-wrap-t texture))))
-(define null-texture (%make-texture 0 0 0 'linear 'linear 'repeat 'repeat))
+(define null-texture
+ (%make-texture 0 0 0 'linear 'linear 'repeat 'repeat (f32vector 0.0 0.0)))
(define <<texture>> (class-of null-texture))
@@ -152,7 +154,8 @@ clamp-to-edge. FORMAT specifies the pixel format. Currently only
(let ((texture (gpu-guard
(%make-texture (gl-generate-texture) width height
- min-filter mag-filter wrap-s wrap-t))))
+ min-filter mag-filter wrap-s wrap-t
+ (f32vector width height)))))
(texture-set! 0 texture)
(gl-texture-parameter (texture-target texture-2d)
(texture-parameter-name texture-min-filter)