From a7f0758e8834967f0a9d655af8eaf7df8b834c00 Mon Sep 17 00:00:00 2001 From: Seth Long Date: Wed, 11 Nov 2026 14:39:25 -0800 Subject: [PATCH] Changed to 4 channel textures, which fixes the HUD for some reason --- gameobject.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gameobject.cpp b/gameobject.cpp index 623e9b8..ed3de73 100644 --- a/gameobject.cpp +++ b/gameobject.cpp @@ -42,7 +42,7 @@ unsigned int load_texture(string texture_file){ printf("Found existing texture for %s\n", texture_file.c_str()); } else { int img_width, img_height; - unsigned char* image = stbi_load(texture_file.c_str(), &img_width, &img_height, 0, STBI_rgb); + unsigned char* image = stbi_load(texture_file.c_str(), &img_width, &img_height, 0, 4); if(!image){ printf("image failed to load: %s\n", texture_file.c_str()); return false; @@ -54,7 +54,7 @@ unsigned int load_texture(string texture_file){ glBindTexture(GL_TEXTURE_2D, tex); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, img_width, img_height, 0, GL_RGB, GL_UNSIGNED_BYTE, image); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, img_width, img_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, image); free(image); gl_resources[texture_file] = tex; } -- 2.47.3