diff --git a/GL/framebuffer.c b/GL/framebuffer.c index 33f5a3a..96c1d43 100644 --- a/GL/framebuffer.c +++ b/GL/framebuffer.c @@ -268,14 +268,14 @@ void APIENTRY glGenerateMipmapEXT(GLenum target) { TextureObject* tex = _glGetBoundTexture(); - if(tex->width != tex->height) { - fprintf(stderr, "[GL ERROR] Mipmaps cannot be supported on non-square textures\n"); + if(!tex || !tex->data || !tex->mipmapCount) { _glKosThrowError(GL_INVALID_OPERATION, __func__); _glKosPrintError(); return; } - if(!tex || !tex->data || !tex->mipmapCount) { + if(tex->width != tex->height) { + fprintf(stderr, "[GL ERROR] Mipmaps cannot be supported on non-square textures\n"); _glKosThrowError(GL_INVALID_OPERATION, __func__); _glKosPrintError(); return;