mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-23 11:12:33 +00:00
Create gl_init_textures_reference
This commit is contained in:
parent
60313f7f48
commit
beb01b5d57
@ -1297,6 +1297,32 @@ static void gl_init_textures_data(gl_t *gl)
|
||||
}
|
||||
}
|
||||
|
||||
static void gl_init_textures_reference(gl_t *gl, unsigned i,
|
||||
GLenum internal_fmt, GLenum texture_fmt, GLenum texture_type)
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D, gl->texture[i]);
|
||||
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, gl->wrap_mode);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, gl->wrap_mode);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl->tex_mag_filter);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl->tex_min_filter);
|
||||
|
||||
#ifdef HAVE_PSGL
|
||||
glTextureReferenceSCE(GL_TEXTURE_2D, 1,
|
||||
gl->tex_w, gl->tex_h, 0,
|
||||
internal_fmt,
|
||||
gl->tex_w * gl->base_size,
|
||||
gl->tex_w * gl->tex_h * i * gl->base_size);
|
||||
#else
|
||||
if (gl->egl_images)
|
||||
return;
|
||||
|
||||
glTexImage2D(GL_TEXTURE_2D,
|
||||
0, internal_fmt, gl->tex_w, gl->tex_h, 0, texture_type,
|
||||
texture_fmt, gl->empty_buf ? gl->empty_buf : NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void gl_init_textures(gl_t *gl, const video_info_t *video)
|
||||
{
|
||||
unsigned i;
|
||||
@ -1356,29 +1382,9 @@ static void gl_init_textures(gl_t *gl, const video_info_t *video)
|
||||
glGenTextures(gl->textures, gl->texture);
|
||||
|
||||
for (i = 0; i < gl->textures; i++)
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D, gl->texture[i]);
|
||||
gl_init_textures_reference(gl, i, internal_fmt,
|
||||
texture_fmt, texture_type);
|
||||
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, gl->wrap_mode);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, gl->wrap_mode);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl->tex_mag_filter);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl->tex_min_filter);
|
||||
|
||||
#ifdef HAVE_PSGL
|
||||
glTextureReferenceSCE(GL_TEXTURE_2D, 1,
|
||||
gl->tex_w, gl->tex_h, 0,
|
||||
internal_fmt,
|
||||
gl->tex_w * gl->base_size,
|
||||
gl->tex_w * gl->tex_h * i * gl->base_size);
|
||||
#else
|
||||
if (gl->egl_images)
|
||||
continue;
|
||||
|
||||
glTexImage2D(GL_TEXTURE_2D,
|
||||
0, internal_fmt, gl->tex_w, gl->tex_h, 0, texture_type,
|
||||
texture_fmt, gl->empty_buf ? gl->empty_buf : NULL);
|
||||
#endif
|
||||
}
|
||||
glBindTexture(GL_TEXTURE_2D, gl->texture[gl->tex_index]);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user