From 3b859f9170f7f7377cb085a587aa21d86015be74 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sat, 13 May 2023 20:38:53 -0400 Subject: graphics: texture: Fix initialization when no pixel data is provided. --- chickadee/graphics/texture.scm | 11 +++++------ 1 file 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 -- cgit v1.2.3