summaryrefslogtreecommitdiff
path: root/cogl/cogl-sub-texture.c
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2012-02-09 11:19:04 +0000
committerNeil Roberts <neil@linux.intel.com>2012-02-13 17:02:46 +0000
commit8012eee31f01011d4b6572d924d7a979470c4afe (patch)
tree32ff8c37bdea9052d5c31aa9a96fdde0a12cac1e /cogl/cogl-sub-texture.c
parent9b87e8602cdac839edd82c3a0c0974ebf20bc7fe (diff)
downloadcogl-8012eee31f01011d4b6572d924d7a979470c4afe.tar.gz
Add _cogl_texture_get_type()
This adds an internal function to get the type of the underlying hardware texture for any CoglTexture. It can return one of three values to represent 2D textures, 3D textures or rectangle textures. The idea is that this can be used as a replacement for cogl_texture_get_gl_texture when only the target is required to make it a bit less GL-centric. The implementation adds a new virtual function which all of the texture backends now implement. The enum is in a public header because a later patch will want to use it from the CoglPipeline API. We may want to consider making the function public too later. Reviewed-by: Robert Bragg <robert@linux.intel.com>
Diffstat (limited to 'cogl/cogl-sub-texture.c')
-rw-r--r--cogl/cogl-sub-texture.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/cogl/cogl-sub-texture.c b/cogl/cogl-sub-texture.c
index 3967ecd6..99ecfcc5 100644
--- a/cogl/cogl-sub-texture.c
+++ b/cogl/cogl-sub-texture.c
@@ -416,6 +416,14 @@ _cogl_sub_texture_get_height (CoglTexture *tex)
return sub_tex->sub_height;
}
+static CoglTextureType
+_cogl_sub_texture_get_type (CoglTexture *tex)
+{
+ CoglSubTexture *sub_tex = COGL_SUB_TEXTURE (tex);
+
+ return _cogl_texture_get_type (sub_tex->full_texture);
+}
+
static const CoglTextureVtable
cogl_sub_texture_vtable =
{
@@ -436,5 +444,6 @@ cogl_sub_texture_vtable =
_cogl_sub_texture_get_gl_format,
_cogl_sub_texture_get_width,
_cogl_sub_texture_get_height,
+ _cogl_sub_texture_get_type,
NULL /* is_foreign */
};