From f873960224c02354173565acf721eb8a6d978ab1 Mon Sep 17 00:00:00 2001 From: Themaister Date: Sat, 26 May 2012 16:01:59 +0200 Subject: [PATCH] init_textures for ps3. --- gfx/gl.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/gfx/gl.c b/gfx/gl.c index f533320928..8a3ecac804 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -776,6 +776,28 @@ static void gl_copy_frame(gl_t *gl, const void *frame, unsigned width, unsigned buffer_addr += buffer_stride; } } + +static void gl_init_textures(gl_t *gl) +{ + glGenTextures(TEXTURES, gl->texture); + + for (unsigned i = 0; i < TEXTURES; i++) + { + glBindTexture(GL_TEXTURE_2D, gl->texture[i]); + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl->tex_filter); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl->tex_filter); + + glTextureReferenceSCE(GL_TEXTURE_2D, 1, + gl->tex_w, gl->tex_h, 0, + gl->texture_fmt, + gl->tex_w * gl->base_size, + gl->tex_w * gl->tex_h * i * gl->base_size); + } + glBindTexture(GL_TEXTURE_2D, gl->texture[gl->tex_index]); +} #else static void gl_copy_frame(gl_t *gl, const void *frame, unsigned width, unsigned height, unsigned pitch) { @@ -784,7 +806,6 @@ static void gl_copy_frame(gl_t *gl, const void *frame, unsigned width, unsigned 0, 0, 0, width, height, gl->texture_type, gl->texture_fmt, frame); } -#endif static void gl_init_textures(gl_t *gl) { @@ -805,6 +826,7 @@ static void gl_init_textures(gl_t *gl) } glBindTexture(GL_TEXTURE_2D, gl->texture[gl->tex_index]); } +#endif static void gl_next_texture_index(gl_t *gl, const struct gl_tex_info *tex_info) {