summaryrefslogtreecommitdiff
path: root/cogl/cogl-texture-driver.h
diff options
context:
space:
mode:
authorDamien Lespiau <damien.lespiau@intel.com>2010-01-25 11:21:05 +0000
committerDamien Lespiau <damien.lespiau@intel.com>2010-02-08 17:14:49 +0000
commitdbef77cd8bfad02a5f2cf4b9c7343e42e584de6a (patch)
tree810428b680067497e088e62911bfbdd5fe1694ad /cogl/cogl-texture-driver.h
parent0adc2c458d5fadbff99d6341093043b5863219a1 (diff)
downloadcogl-dbef77cd8bfad02a5f2cf4b9c7343e42e584de6a.tar.gz
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.
Diffstat (limited to 'cogl/cogl-texture-driver.h')
-rw-r--r--cogl/cogl-texture-driver.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/cogl/cogl-texture-driver.h b/cogl/cogl-texture-driver.h
index 6961659d..5f08cfba 100644
--- a/cogl/cogl-texture-driver.h
+++ b/cogl/cogl-texture-driver.h
@@ -25,6 +25,15 @@
#define __COGL_TEXTURE_DRIVER_H
/*
+ * A very small wrapper around glGenTextures() that ensures we default to
+ * non-mipmap filters when creating textures. This is to save some memory as
+ * the driver will not allocate room for the mipmap tree.
+ */
+void
+_cogl_texture_driver_gen (GLenum gl_target,
+ GLsizei n,
+ GLuint *textures);
+/*
* Basically just a wrapper around glBindTexture, but the GLES2 backend
* for example also wants to know about the internal format so it can
* identify when alpha only textures are bound.