summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2023-05-13 20:38:53 -0400
committerDavid Thompson <dthompson2@worcester.edu>2023-05-13 20:38:53 -0400
commit3b859f9170f7f7377cb085a587aa21d86015be74 (patch)
treec2ead6c4e751c490117d7dc3e018bcb19539ded9
parent84f018bdd9471b8b2a804e23054f37c3b69a87da (diff)
graphics: texture: Fix initialization when no pixel data is provided.
-rw-r--r--chickadee/graphics/texture.scm11
1 files changed, 5 insertions, 6 deletions
diff --git a/chickadee/graphics/texture.scm b/chickadee/graphics/texture.scm
index a008174..b6595ee 100644
--- a/chickadee/graphics/texture.scm
+++ b/chickadee/graphics/texture.scm
@@ -271,12 +271,11 @@ Currently only 32-bit RGBA format is supported."
(gl-texture-parameter (texture-target texture-2d)
(texture-parameter-name texture-wrap-t)
(gl-wrap-mode wrap-t))
- (when pixels
- (gl-texture-image-2d (texture-target texture-2d)
- 0 (pixel-format rgba) width height 0
- (gl-pixel-format format)
- (color-pointer-type unsigned-byte)
- pixels))
+ (gl-texture-image-2d (texture-target texture-2d)
+ 0 (pixel-format rgba) width height 0
+ (gl-pixel-format format)
+ (color-pointer-type unsigned-byte)
+ (or pixels %null-pointer))
;; Generate mipmaps, if needed.
(when (memq min-filter
'(nearest-mipmap-nearest