summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2013-06-26 22:50:11 +0100
committerRobert Bragg <robert@linux.intel.com>2013-12-02 15:31:19 +0000
commita8480eddca6d325fa768af89205dbf743bb06236 (patch)
tree59cbbf30925211f8db2a75b2f742d65a7c0dd0c7
parent11af12bc7ee1c4d4b377a33d68a8c7e57e8e38e3 (diff)
downloadcogl-a8480eddca6d325fa768af89205dbf743bb06236.tar.gz
ensure texture allocated in _get_gl_texture() in preparation
The plan is to defer a lot more work in creating a texture until allocation time. This means we wont be able to assume that all textures being used to render must have already been allocated when data was specified. The latest point at which we will generally require a texture to be allocated will be when we need to know the underlying GL handle for a texture and so this updates cogl_texture_get_gl_texture() to ensure the texture is allocated.
-rw-r--r--cogl/cogl-texture.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/cogl/cogl-texture.c b/cogl/cogl-texture.c
index ad063f66..ec6b7100 100644
--- a/cogl/cogl-texture.c
+++ b/cogl/cogl-texture.c
@@ -282,6 +282,9 @@ cogl_texture_get_gl_texture (CoglTexture *texture,
GLuint *out_gl_handle,
GLenum *out_gl_target)
{
+ if (!texture->allocated)
+ cogl_texture_allocate (texture, NULL);
+
return texture->vtable->get_gl_texture (texture,
out_gl_handle, out_gl_target);
}