summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2018-01-17 21:45:08 -0500
committerMatthias Clasen <mclasen@redhat.com>2018-01-17 21:45:08 -0500
commite1d81d096cc6115bb7da033b1085ea909d645448 (patch)
tree500442942c391d00d8e2a2e657228c2a5d0631d6 /gdk
parent47b7bfd2ba5e5cd4ca2873021c2fdc5ce148812d (diff)
downloadgtk+-e1d81d096cc6115bb7da033b1085ea909d645448.tar.gz
Document new texture api
Diffstat (limited to 'gdk')
-rw-r--r--gdk/gdktexture.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/gdk/gdktexture.c b/gdk/gdktexture.c
index f85b096ec0..aefb82c677 100644
--- a/gdk/gdktexture.c
+++ b/gdk/gdktexture.c
@@ -541,6 +541,19 @@ gdk_gl_texture_get_id (GdkGLTexture *self)
return self->id;
}
+/**
+ * gdk_texture_release_gl:
+ * @texture: a #GdkTexture wrapping a GL texture
+ *
+ * Releases the GL resources held by a #GdkTexture that
+ * was created with gdk_texture_new_for_gl().
+ *
+ * The texture contents are still available via the
+ * gdk_texture_download() function, after this function
+ * has been called.
+ *
+ * Since: 3.94
+ */
void
gdk_texture_release_gl (GdkTexture *texture)
{
@@ -676,6 +689,26 @@ gdk_texture_new_from_file (GFile *file,
return texture;
}
+/**
+ * gdk_texture_new_for_gl:
+ * @context: a #GdkGLContext
+ * @id: the ID of a texture that was created with @context
+ * @width: the nominal width of the texture
+ * @height: the nominal height of the texture
+ * @destroy: a destroy notify that will be called when the GL resources
+ * are released
+ * @data: data that gets passed to @destroy
+ *
+ * Creates a new texture for an existing GL texture.
+ *
+ * Note that the GL texture must not be modified until @destroy is called,
+ * which will happen when the GdkTexture object is finalized, or due to
+ * an explicit call of gdk_texture_release_gl().
+ *
+ * Return value: A newly-created #GdkTexture
+ *
+ * Since: 3.94
+ **/
GdkTexture *
gdk_texture_new_for_gl (GdkGLContext *context,
int id,