cogl: new textures sould have GL_TEXTURE_MIN_FILTER set to GL_LINEAR
authorDamien Lespiau <damien.lespiau@intel.com>
Mon, 25 Jan 2010 11:21:05 +0000 (11:21 +0000)
committerDamien Lespiau <damien.lespiau@intel.com>
Mon, 8 Feb 2010 17:14:49 +0000 (17:14 +0000)
commitde8a6314f12854e748de515afb487af56eaac845
tree589a073126dbf23ff94017dd4a45398fb3b02e8a
parentc0f65212baee25dd4e66f4366a54bd847c782eb3
cogl: new textures sould have GL_TEXTURE_MIN_FILTER set to GL_LINEAR

The only way the user has to set the mipmap filters is through the
material/layer API. This API defaults to GL_LINEAR/GL_LINEAR for the max
and min filters. With the main use case of cogl being 2D interfaces, it
makes sense do default to GL_LINEAR for the min filter.

When creating new textures, we did not set any filter on them, using
OpenGL defaults': GL_NEAREST_MIPMAP_LINEAR for the min filter and
GL_LINEAR for the max filter. This will make the driver allocate memory
for the mipmap tree, memory that will not be used in the nominal case
(as the material API defaults to GL_LINEAR).

This patch tries to ensure that the min filter is set to GL_LINEAR
before any glTexImage*() call is done on the texture by setting the
filter when generating new OpenGL handles.
clutter/cogl/cogl/cogl-texture-2d-sliced.c
clutter/cogl/cogl/cogl-texture-2d.c
clutter/cogl/cogl/cogl-texture-driver.h
clutter/cogl/cogl/driver/gl/cogl-texture-driver.c
clutter/cogl/cogl/driver/gles/cogl-texture-driver.c