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.
This commit is contained in:
Neil Roberts 2010-02-09 12:21:10 +00:00
parent 1b2ff7eff7
commit a02253f19a

View File

@ -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) );