added gpuready check to gentexturemipmaps (#5747)

This commit is contained in:
Thomas Anderson
2026-04-10 08:42:06 -05:00
committed by GitHub
parent fbcc8cdb55
commit de95b3aa70

View File

@ -3685,6 +3685,8 @@ void rlUnloadTexture(unsigned int id)
// NOTE: Only supports GPU mipmap generation
void rlGenTextureMipmaps(unsigned int id, int width, int height, int format, int *mipmaps)
{
if (!isGpuReady) { TRACELOG(RL_LOG_WARNING, "GL: GPU is not ready to load data, trying to load before InitWindow()?"); return; }
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
glBindTexture(GL_TEXTURE_2D, id);