From 2938ae0475f7630a7be721c5f2d81feb34564182 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Tue, 9 Feb 2010 12:21:10 +0000 Subject: [PATCH] cogl-texture-2d: Use _cogl_texture_driver_gen to generate the GL tex _cogl_texture_driver_gen is needed to set the texture minification mode to Cogl's default of GL_LINEAR. There was also a line to set this in _cogl_texture_2d_new_with_size but it wasn't working because it was called *before* the texture was bound. If the texture was later rendered with the default material it then it would end up with GL's default mipmap filtering mode but without mipmaps so it would render white squares instead. --- cogl/cogl-texture-2d.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cogl/cogl-texture-2d.c b/cogl/cogl-texture-2d.c index b700eb19f..a86f84408 100644 --- a/cogl/cogl-texture-2d.c +++ b/cogl/cogl-texture-2d.c @@ -262,8 +262,7 @@ _cogl_texture_2d_new_with_size (unsigned int width, tex_2d = _cogl_texture_2d_create_base (width, height, flags, internal_format); - GE( glGenTextures (1, &tex_2d->gl_texture) ); - GE( glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR) ); + _cogl_texture_driver_gen (GL_TEXTURE_2D, 1, &tex_2d->gl_texture); GE( glBindTexture (GL_TEXTURE_2D, tex_2d->gl_texture) ); GE( glTexImage2D (GL_TEXTURE_2D, 0, gl_intformat, width, height, 0, gl_format, gl_type, NULL) );