diff options
author | Neil Roberts <neil@linux.intel.com> | 2012-02-09 11:19:04 +0000 |
---|---|---|
committer | Neil Roberts <neil@linux.intel.com> | 2012-02-13 17:02:46 +0000 |
commit | 8012eee31f01011d4b6572d924d7a979470c4afe (patch) | |
tree | 32ff8c37bdea9052d5c31aa9a96fdde0a12cac1e /cogl/cogl-texture-private.h | |
parent | 9b87e8602cdac839edd82c3a0c0974ebf20bc7fe (diff) | |
download | cogl-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-texture-private.h')
-rw-r--r-- | cogl/cogl-texture-private.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cogl/cogl-texture-private.h b/cogl/cogl-texture-private.h index 1048b210..2f7d9251 100644 --- a/cogl/cogl-texture-private.h +++ b/cogl/cogl-texture-private.h @@ -121,6 +121,8 @@ struct _CoglTextureVtable int (* get_width) (CoglTexture *tex); int (* get_height) (CoglTexture *tex); + CoglTextureType (* get_type) (CoglTexture *tex); + gboolean (* is_foreign) (CoglTexture *tex); }; @@ -274,4 +276,16 @@ _cogl_texture_spans_foreach_in_region (CoglSpan *x_spans, CoglMetaTextureCallback callback, void *user_data); +/* + * _cogl_texture_get_type: + * @texture: a #CoglTexture pointer + * + * Retrieves the texture type of the underlying hardware texture that + * this #CoglTexture will use. + * + * Return value: The type of the hardware texture. + */ +CoglTextureType +_cogl_texture_get_type (CoglTexture *texture); + #endif /* __COGL_TEXTURE_PRIVATE_H */ |