summaryrefslogtreecommitdiff
path: root/cogl/cogl-texture-2d.h
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2013-06-08 02:10:15 +0100
committerRobert Bragg <robert@linux.intel.com>2013-07-11 20:18:03 +0100
commit10e91aa513123ed277a8d45976f8d75445d7dc9c (patch)
tree0d19753ff18d2291b458de97dc13b47bff0c25d7 /cogl/cogl-texture-2d.h
parentfe515e6063ba4c3ddb5cd00d2c8527d9a6336a12 (diff)
downloadcogl-10e91aa513123ed277a8d45976f8d75445d7dc9c.tar.gz
texture-2d: Add _new_from_file api
This adds a cogl_texture_2d_new_from_file() api since we are planning to remove cogl_texture_new_from_file() but don't want to loose the convenience it had. Reviewed-by: Neil Roberts <neil@linux.intel.com>
Diffstat (limited to 'cogl/cogl-texture-2d.h')
-rw-r--r--cogl/cogl-texture-2d.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/cogl/cogl-texture-2d.h b/cogl/cogl-texture-2d.h
index 5a5ff2f5..c1ae57f2 100644
--- a/cogl/cogl-texture-2d.h
+++ b/cogl/cogl-texture-2d.h
@@ -103,6 +103,33 @@ cogl_texture_2d_new_with_size (CoglContext *ctx,
CoglPixelFormat internal_format);
/**
+ * cogl_texture_2d_new_from_file:
+ * @ctx: A #CoglContext
+ * @filename: the file to load
+ * @internal_format: the #CoglPixelFormat to use for the GPU storage of the
+ * texture. If %COGL_PIXEL_FORMAT_ANY is given then a premultiplied
+ * format similar to the format of the source data will be used. The
+ * default blending equations of Cogl expect premultiplied color data;
+ * the main use of passing a non-premultiplied format here is if you
+ * have non-premultiplied source data and are going to adjust the blend
+ * mode (see cogl_material_set_blend()) or use the data for something
+ * other than straight blending.
+ * @error: A #CoglError to catch exceptional errors or %NULL
+ *
+ * Creates a #CoglTexture2D from an image file.
+ *
+ * Return value: A newly created #CoglTexture2D or %NULL on failure
+ * and @error will be updated.
+ *
+ * Since: 1.16
+ */
+CoglTexture2D *
+cogl_texture_2d_new_from_file (CoglContext *ctx,
+ const char *filename,
+ CoglPixelFormat internal_format,
+ CoglError **error);
+
+/**
* cogl_texture_2d_new_from_data:
* @ctx: A #CoglContext
* @width: width of texture in pixels