From ab33d16da148d1817e5936011c43f90853e5da58 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 3 Apr 2019 16:33:16 +0200 Subject: [PATCH] Small cleanup --- gfx/drivers/gl.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/gfx/drivers/gl.c b/gfx/drivers/gl.c index 2b8c725ebe..e1484a7e0e 100644 --- a/gfx/drivers/gl.c +++ b/gfx/drivers/gl.c @@ -351,18 +351,20 @@ static void gl2_load_texture_image(GLenum target, { #if !defined(HAVE_PSGL) && !defined(ORBIS) #ifdef HAVE_OPENGLES2 - if (gl_check_capability(GL_CAPS_TEX_STORAGE_EXT) && internalFormat != GL_BGRA_EXT) - { - gl2_size_format(&internalFormat); - glTexStorage2DEXT(target, 1, internalFormat, width, height); - } + unsigned cap = GL_CAPS_TEX_STORAGE_EXT; #else - if (gl_check_capability(GL_CAPS_TEX_STORAGE) && internalFormat != GL_BGRA_EXT) + unsigned cap = GL_CAPS_TEX_STORAGE; +#endif + + if (gl_check_capability(cap) && internalFormat != GL_BGRA_EXT) { gl2_size_format(&internalFormat); - glTexStorage2D(target, 1, internalFormat, width, height); - } +#ifdef HAVE_OPENGLES2 + glTexStorage2DEXT(target, 1, internalFormat, width, height); +#else + glTexStorage2D (target, 1, internalFormat, width, height); #endif + } else #endif {