(XMB)(GLUI) Better fix for the GL texture format bug

This commit is contained in:
Jean-André Santoni 2015-02-07 00:05:40 +01:00
parent 48e56da8be
commit ef7e210719
2 changed files with 10 additions and 8 deletions

View File

@ -509,8 +509,11 @@ static GLuint glui_png_texture_load_(const char * file_name)
/* Generate the OpenGL texture object */
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D, texture);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, ti.width, ti.height, 0,
GL_RGBA, GL_UNSIGNED_BYTE, ti.pixels);
glTexImage2D(GL_TEXTURE_2D, 0, driver.gfx_use_rgba ?
GL_RGBA : RARCH_GL_INTERNAL_FORMAT32,
ti.width, ti.height, 0,
driver.gfx_use_rgba ? GL_RGBA : RARCH_GL_TEXTURE_TYPE32,
RARCH_GL_FORMAT32, ti.pixels);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
@ -553,8 +556,6 @@ static void glui_context_reset(void *data)
(void)gl;
driver.gfx_use_rgba = true;
if (!menu)
return;

View File

@ -586,8 +586,11 @@ static GLuint xmb_png_texture_load_(const char * file_name)
/* Generate the OpenGL texture object */
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D, texture);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, ti.width, ti.height, 0,
GL_RGBA, GL_UNSIGNED_BYTE, ti.pixels);
glTexImage2D(GL_TEXTURE_2D, 0, driver.gfx_use_rgba ?
GL_RGBA : RARCH_GL_INTERNAL_FORMAT32,
ti.width, ti.height, 0,
driver.gfx_use_rgba ? GL_RGBA : RARCH_GL_TEXTURE_TYPE32,
RARCH_GL_FORMAT32, ti.pixels);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glGenerateMipmap(GL_TEXTURE_2D);
@ -1331,8 +1334,6 @@ static void xmb_context_reset(void *data)
if (!xmb)
return;
driver.gfx_use_rgba = true;
fill_pathname_join(bgpath, g_settings.assets_directory,
"xmb", sizeof(bgpath));