<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="gdk4-Textures">
<refmeta>
<refentrytitle role="top_of_page" id="gdk4-Textures.top_of_page">GdkTexture</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GDK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GdkTexture</refname>
<refpurpose>Pixel data</refpurpose>
</refnamediv>

<refsect1 id="gdk4-Textures.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_proto_type" colwidth="150px"/>
<colspec colname="functions_proto_name"/>
<tbody>
<row><entry role="function_type"><link linkend="GdkTexture"><returnvalue>GdkTexture</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gdk-texture-new-for-pixbuf">gdk_texture_new_for_pixbuf</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkTexture"><returnvalue>GdkTexture</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gdk-texture-new-from-resource">gdk_texture_new_from_resource</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkTexture"><returnvalue>GdkTexture</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gdk-texture-new-from-file">gdk_texture_new_from_file</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="int"><returnvalue>int</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-texture-get-width">gdk_texture_get_width</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="int"><returnvalue>int</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-texture-get-height">gdk_texture_get_height</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-texture-download">gdk_texture_download</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-texture-save-to-png">gdk_texture_save_to_png</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkTexture"><returnvalue>GdkTexture</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gdk-memory-texture-new">gdk_memory_texture_new</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkTexture"><returnvalue>GdkTexture</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gdk-gl-texture-new">gdk_gl_texture_new</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-gl-texture-release">gdk_gl_texture_release</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="gdk4-Textures.properties" role="properties">
<title role="properties.title">Properties</title>
<informaltable frame="none">
<tgroup cols="3">
<colspec colname="properties_type" colwidth="150px"/>
<colspec colname="properties_name" colwidth="300px"/>
<colspec colname="properties_flags" colwidth="200px"/>
<tbody>
<row><entry role="property_type"><link linkend="int"><type>int</type></link></entry><entry role="property_name"><link linkend="GdkTexture--height">height</link></entry><entry role="property_flags">Read / Write / Construct&#160;Only</entry></row>
<row><entry role="property_type"><link linkend="int"><type>int</type></link></entry><entry role="property_name"><link linkend="GdkTexture--width">width</link></entry><entry role="property_flags">Read / Write / Construct&#160;Only</entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<anchor id="GdkTexture"/><anchor id="GdkMemoryTexture"/><anchor id="GdkGLTexture"/><refsect1 id="gdk4-Textures.other" role="other_proto">
<title role="other_proto.title">Types and Values</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="other_proto_type" colwidth="150px"/>
<colspec colname="other_proto_name"/>
<tbody>
<row><entry role="datatype_keyword"></entry><entry role="function_name"><link linkend="GdkTexture-struct">GdkTexture</link></entry></row>
<row><entry role="datatype_keyword"></entry><entry role="function_name"><link linkend="GdkMemoryTexture-struct">GdkMemoryTexture</link></entry></row>
<row><entry role="datatype_keyword"></entry><entry role="function_name"><link linkend="GdkGLTexture-struct">GdkGLTexture</link></entry></row>
<row><entry role="datatype_keyword">enum</entry><entry role="function_name"><link linkend="GdkMemoryFormat">GdkMemoryFormat</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GDK-MEMORY-DEFAULT:CAPS">GDK_MEMORY_DEFAULT</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="gdk4-Textures.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<screen>    <link linkend="GObject">GObject</link>
    <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> GdkTexture
        <phrase role="lineart">&#9500;&#9472;&#9472;</phrase> GdkGLTexture
        <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> GdkMemoryTexture
</screen>
</refsect1>
<refsect1 id="gdk4-Textures.implemented-interfaces" role="impl_interfaces">
<title role="impl_interfaces.title">Implemented Interfaces</title>
<para>
GdkTexture implements
 <link linkend="GdkPaintable">GdkPaintable</link>.</para>
<para>
GdkMemoryTexture implements
 <link linkend="GdkPaintable">GdkPaintable</link>.</para>
<para>
GdkGLTexture implements
 <link linkend="GdkPaintable">GdkPaintable</link>.</para>

</refsect1>

<refsect1 id="gdk4-Textures.includes"><title>Includes</title><synopsis>#include &lt;gdk/gdk.h&gt;
</synopsis></refsect1>

<refsect1 id="gdk4-Textures.description" role="desc">
<title role="desc.title">Description</title>
<para><link linkend="GdkTexture"><type>GdkTexture</type></link> is the basic element used to refer to pixel data.
It is primarily mean for pixel data that will not change over
multiple frames, and will be used for a long time.</para>
<para>There are various ways to create <link linkend="GdkTexture"><type>GdkTexture</type></link> objects from a
<link linkend="GdkPixbuf"><type>GdkPixbuf</type></link>, or a Cairo surface, or other pixel data.</para>
<para>The ownership of the pixel data is transferred to the <link linkend="GdkTexture"><type>GdkTexture</type></link>
instance; you can only make a copy of it, via <link linkend="gdk-texture-download"><function>gdk_texture_download()</function></link>.</para>
<para><link linkend="GdkTexture"><type>GdkTexture</type></link> is an immutable object: That means you cannot change
anything about it other than increasing the reference count via
<link linkend="g-object-ref"><function>g_object_ref()</function></link>.</para>

</refsect1>
<refsect1 id="gdk4-Textures.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gdk-texture-new-for-pixbuf" role="function">
<title>gdk_texture_new_for_pixbuf&#160;()</title>
<indexterm zone="gdk-texture-new-for-pixbuf"><primary>gdk_texture_new_for_pixbuf</primary></indexterm>
<programlisting language="C"><link linkend="GdkTexture"><returnvalue>GdkTexture</returnvalue></link>&#160;*
gdk_texture_new_for_pixbuf (<parameter><link linkend="GdkPixbuf"><type>GdkPixbuf</type></link> *pixbuf</parameter>);</programlisting>
<para>Creates a new texture object representing the GdkPixbuf.</para>
<refsect3 id="gdk-texture-new-for-pixbuf.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>pixbuf</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkPixbuf"><type>GdkPixbuf</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-texture-new-for-pixbuf.returns" role="returns">
<title>Returns</title>
<para> a new <link linkend="GdkTexture"><type>GdkTexture</type></link></para>
</refsect3></refsect2>
<refsect2 id="gdk-texture-new-from-resource" role="function">
<title>gdk_texture_new_from_resource&#160;()</title>
<indexterm zone="gdk-texture-new-from-resource"><primary>gdk_texture_new_from_resource</primary></indexterm>
<programlisting language="C"><link linkend="GdkTexture"><returnvalue>GdkTexture</returnvalue></link>&#160;*
gdk_texture_new_from_resource (<parameter>const <link linkend="char"><type>char</type></link> *resource_path</parameter>);</programlisting>
<para>Creates a new texture by loading an image from a resource.
The file format is detected automatically.</para>
<para>It is a fatal error if <parameter>resource_path</parameter>
 does not specify a valid
image resource and the program will abort if that happens.
If you are unsure about the validity of a resource, use
<link linkend="gdk-texture-new-from-file"><function>gdk_texture_new_from_file()</function></link> to load it.</para>
<refsect3 id="gdk-texture-new-from-resource.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>resource_path</para></entry>
<entry role="parameter_description"><para>the path of the resource file</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-texture-new-from-resource.returns" role="returns">
<title>Returns</title>
<para> A newly-created texture</para>
</refsect3></refsect2>
<refsect2 id="gdk-texture-new-from-file" role="function">
<title>gdk_texture_new_from_file&#160;()</title>
<indexterm zone="gdk-texture-new-from-file"><primary>gdk_texture_new_from_file</primary></indexterm>
<programlisting language="C"><link linkend="GdkTexture"><returnvalue>GdkTexture</returnvalue></link>&#160;*
gdk_texture_new_from_file (<parameter><link linkend="GFile"><type>GFile</type></link> *file</parameter>,
                           <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Creates a new texture by loading an image from a file.  The file format is
detected automatically. If <link linkend="NULL:CAPS"><literal>NULL</literal></link> is returned, then <parameter>error</parameter>
 will be set.</para>
<refsect3 id="gdk-texture-new-from-file.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>file</para></entry>
<entry role="parameter_description"><para><link linkend="GFile"><type>GFile</type></link> to load</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>Return location for an error</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-texture-new-from-file.returns" role="returns">
<title>Returns</title>
<para> A newly-created <link linkend="GdkTexture"><type>GdkTexture</type></link> or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if an error occurred.</para>
</refsect3></refsect2>
<refsect2 id="gdk-texture-get-width" role="function">
<title>gdk_texture_get_width&#160;()</title>
<indexterm zone="gdk-texture-get-width"><primary>gdk_texture_get_width</primary></indexterm>
<programlisting language="C"><link linkend="int"><returnvalue>int</returnvalue></link>
gdk_texture_get_width (<parameter><link linkend="GdkTexture"><type>GdkTexture</type></link> *texture</parameter>);</programlisting>
<para>Returns the width of <parameter>texture</parameter>
.</para>
<refsect3 id="gdk-texture-get-width.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>texture</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkTexture"><type>GdkTexture</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-texture-get-width.returns" role="returns">
<title>Returns</title>
<para> the width of the <link linkend="GdkTexture"><type>GdkTexture</type></link></para>
</refsect3></refsect2>
<refsect2 id="gdk-texture-get-height" role="function">
<title>gdk_texture_get_height&#160;()</title>
<indexterm zone="gdk-texture-get-height"><primary>gdk_texture_get_height</primary></indexterm>
<programlisting language="C"><link linkend="int"><returnvalue>int</returnvalue></link>
gdk_texture_get_height (<parameter><link linkend="GdkTexture"><type>GdkTexture</type></link> *texture</parameter>);</programlisting>
<para>Returns the height of the <parameter>texture</parameter>
.</para>
<refsect3 id="gdk-texture-get-height.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>texture</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkTexture"><type>GdkTexture</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-texture-get-height.returns" role="returns">
<title>Returns</title>
<para> the height of the <link linkend="GdkTexture"><type>GdkTexture</type></link></para>
</refsect3></refsect2>
<refsect2 id="gdk-texture-download" role="function">
<title>gdk_texture_download&#160;()</title>
<indexterm zone="gdk-texture-download"><primary>gdk_texture_download</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gdk_texture_download (<parameter><link linkend="GdkTexture"><type>GdkTexture</type></link> *texture</parameter>,
                      <parameter><link linkend="guchar"><type>guchar</type></link> *data</parameter>,
                      <parameter><link linkend="gsize"><type>gsize</type></link> stride</parameter>);</programlisting>
<para>Downloads the <parameter>texture</parameter>
 into local memory. This may be
an expensive operation, as the actual texture data may
reside on a GPU or on a remote display server.</para>
<para>The data format of the downloaded data is equivalent to
<link linkend="CAIRO-FORMAT-ARGB32:CAPS"><literal>CAIRO_FORMAT_ARGB32</literal></link>, so every downloaded pixel requires
4 bytes of memory.</para>
<para>Downloading a texture into a Cairo image surface:</para>
<informalexample><programlisting role="example"><![CDATA[
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
                                      gdk_texture_get_width (texture),
                                      gdk_texture_get_height (texture));
gdk_texture_download (texture,
                      cairo_image_surface_get_data (surface),
                      cairo_image_surface_get_stride (surface));
cairo_surface_mark_dirty (surface);
]]></programlisting></informalexample>
<para></para>
<refsect3 id="gdk-texture-download.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>texture</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkTexture"><type>GdkTexture</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>data</para></entry>
<entry role="parameter_description"><para>pointer to enough memory to be filled with the
downloaded data of <parameter>texture</parameter>
. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>array</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>stride</para></entry>
<entry role="parameter_description"><para>rowstride in bytes</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gdk-texture-save-to-png" role="function">
<title>gdk_texture_save_to_png&#160;()</title>
<indexterm zone="gdk-texture-save-to-png"><primary>gdk_texture_save_to_png</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gdk_texture_save_to_png (<parameter><link linkend="GdkTexture"><type>GdkTexture</type></link> *texture</parameter>,
                         <parameter>const <link linkend="char"><type>char</type></link> *filename</parameter>);</programlisting>
<para>Store the given <parameter>texture</parameter>
 to the <parameter>filename</parameter>
 as a PNG file.</para>
<para>This is a utility function intended for debugging and testing.
If you want more control over formats, proper error handling or
want to store to a <link linkend="GFile"><type>GFile</type></link> or other location, you might want to
look into using the gdk-pixbuf library.</para>
<refsect3 id="gdk-texture-save-to-png.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>texture</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkTexture"><type>GdkTexture</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>filename</para></entry>
<entry role="parameter_description"><para>the filename to store to</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-texture-save-to-png.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if saving succeeded, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> on failure.</para>
</refsect3></refsect2>
<refsect2 id="gdk-memory-texture-new" role="function">
<title>gdk_memory_texture_new&#160;()</title>
<indexterm zone="gdk-memory-texture-new"><primary>gdk_memory_texture_new</primary></indexterm>
<programlisting language="C"><link linkend="GdkTexture"><returnvalue>GdkTexture</returnvalue></link>&#160;*
gdk_memory_texture_new (<parameter><link linkend="int"><type>int</type></link> width</parameter>,
                        <parameter><link linkend="int"><type>int</type></link> height</parameter>,
                        <parameter><link linkend="GdkMemoryFormat"><type>GdkMemoryFormat</type></link> format</parameter>,
                        <parameter><link linkend="GBytes"><type>GBytes</type></link> *bytes</parameter>,
                        <parameter><link linkend="gsize"><type>gsize</type></link> stride</parameter>);</programlisting>
<para>Creates a new texture for a blob of image data.
The <link linkend="GBytes"><type>GBytes</type></link> must contain <parameter>stride</parameter>
 x <parameter>height</parameter>
 pixels
in the given format.</para>
<refsect3 id="gdk-memory-texture-new.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>width</para></entry>
<entry role="parameter_description"><para>the width of the texture</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>height</para></entry>
<entry role="parameter_description"><para>the height of the texture</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>format</para></entry>
<entry role="parameter_description"><para>the format of the data</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>bytes</para></entry>
<entry role="parameter_description"><para>the <link linkend="GBytes"><type>GBytes</type></link> containing the pixel data</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>stride</para></entry>
<entry role="parameter_description"><para>rowstride for the data</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-memory-texture-new.returns" role="returns">
<title>Returns</title>
<para> A newly-created <link linkend="GdkTexture"><type>GdkTexture</type></link></para>
</refsect3></refsect2>
<refsect2 id="gdk-gl-texture-new" role="function">
<title>gdk_gl_texture_new&#160;()</title>
<indexterm zone="gdk-gl-texture-new"><primary>gdk_gl_texture_new</primary></indexterm>
<programlisting language="C"><link linkend="GdkTexture"><returnvalue>GdkTexture</returnvalue></link>&#160;*
gdk_gl_texture_new (<parameter><link linkend="GdkGLContext"><type>GdkGLContext</type></link> *context</parameter>,
                    <parameter><link linkend="guint"><type>guint</type></link> id</parameter>,
                    <parameter><link linkend="int"><type>int</type></link> width</parameter>,
                    <parameter><link linkend="int"><type>int</type></link> height</parameter>,
                    <parameter><link linkend="GDestroyNotify"><type>GDestroyNotify</type></link> destroy</parameter>,
                    <parameter><link linkend="gpointer"><type>gpointer</type></link> data</parameter>);</programlisting>
<para>Creates a new texture for an existing GL texture.</para>
<para>Note that the GL texture must not be modified until <parameter>destroy</parameter>
 is called,
which will happen when the GdkTexture object is finalized, or due to
an explicit call of <link linkend="gdk-gl-texture-release"><function>gdk_gl_texture_release()</function></link>.</para>
<refsect3 id="gdk-gl-texture-new.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>context</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkGLContext"><type>GdkGLContext</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>id</para></entry>
<entry role="parameter_description"><para>the ID of a texture that was created with <parameter>context</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>width</para></entry>
<entry role="parameter_description"><para>the nominal width of the texture</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>height</para></entry>
<entry role="parameter_description"><para>the nominal height of the texture</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>destroy</para></entry>
<entry role="parameter_description"><para>a destroy notify that will be called when the GL resources
are released</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>data</para></entry>
<entry role="parameter_description"><para>data that gets passed to <parameter>destroy</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-gl-texture-new.returns" role="returns">
<title>Returns</title>
<para>A newly-created <link linkend="GdkTexture"><type>GdkTexture</type></link>. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gdk-gl-texture-release" role="function">
<title>gdk_gl_texture_release&#160;()</title>
<indexterm zone="gdk-gl-texture-release"><primary>gdk_gl_texture_release</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gdk_gl_texture_release (<parameter><link linkend="GdkGLTexture"><type>GdkGLTexture</type></link> *self</parameter>);</programlisting>
<para>Releases the GL resources held by a <link linkend="GdkGLTexture"><type>GdkGLTexture</type></link> that
was created with <link linkend="gdk-gl-texture-new"><function>gdk_gl_texture_new()</function></link>.</para>
<para>The texture contents are still available via the
<link linkend="gdk-texture-download"><function>gdk_texture_download()</function></link> function, after this function
has been called.</para>
<refsect3 id="gdk-gl-texture-release.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkTexture"><type>GdkTexture</type></link> wrapping a GL texture</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>

</refsect1>
<refsect1 id="gdk4-Textures.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="GdkTexture-struct" role="struct">
<title>GdkTexture</title>
<indexterm zone="GdkTexture-struct"><primary>GdkTexture</primary></indexterm>
<programlisting language="C">typedef struct _GdkTexture GdkTexture;</programlisting>
<para>The <literal>GdkTexture</literal> structure contains only private data.</para>
</refsect2>
<refsect2 id="GdkMemoryTexture-struct" role="struct">
<title>GdkMemoryTexture</title>
<indexterm zone="GdkMemoryTexture-struct"><primary>GdkMemoryTexture</primary></indexterm>
<programlisting language="C">typedef struct _GdkMemoryTexture GdkMemoryTexture;</programlisting>
</refsect2>
<refsect2 id="GdkGLTexture-struct" role="struct">
<title>GdkGLTexture</title>
<indexterm zone="GdkGLTexture-struct"><primary>GdkGLTexture</primary></indexterm>
<programlisting language="C">typedef struct _GdkGLTexture GdkGLTexture;</programlisting>
</refsect2>
<refsect2 id="GdkMemoryFormat" role="enum">
<title>enum GdkMemoryFormat</title>
<indexterm zone="GdkMemoryFormat"><primary>GdkMemoryFormat</primary></indexterm>
<para><link linkend="GdkMemoryFormat"><type>GdkMemoryFormat</type></link> describes a format that bytes can have in memory.</para>
<para>It describes formats by listing the contents of the memory passed to it.
So GDK_MEMORY_A8R8G8B8 will be 1 byte (8 bits) of alpha, followed by a
byte each of red, green and blue. It is not endian-dependent, so
CAIRO_FORMAT_ARGB32 is represented by different <link linkend="GdkMemoryFormats"><type>GdkMemoryFormats</type></link> on
architectures with different endiannesses.</para>
<para>Its naming is modelled after VkFormat (see
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html<link linkend="VkFormat"><type>VkFormat</type></link>
for details).</para>
<refsect3 id="GdkMemoryFormat.members" role="enum_members">
<title>Members</title>
<informaltable role="enum_members_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="enum_members_name" colwidth="300px"/>
<colspec colname="enum_members_description"/>
<colspec colname="enum_members_annotations" colwidth="200px"/>
<tbody>
<row role="constant"><entry role="enum_member_name"><para id="GDK-MEMORY-B8G8R8A8-PREMULTIPLIED:CAPS">GDK_MEMORY_B8G8R8A8_PREMULTIPLIED</para></entry>
<entry role="enum_member_description"><para>4 bytes; for blue, green, red, alpha.
The color values are premultiplied with the alpha value.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GDK-MEMORY-A8R8G8B8-PREMULTIPLIED:CAPS">GDK_MEMORY_A8R8G8B8_PREMULTIPLIED</para></entry>
<entry role="enum_member_description"><para>4 bytes; for alpha, red, green, blue.
The color values are premultiplied with the alpha value.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GDK-MEMORY-R8G8B8A8-PREMULTIPLIED:CAPS">GDK_MEMORY_R8G8B8A8_PREMULTIPLIED</para></entry>
<entry role="enum_member_description"><para>4 bytes; for red, green, blue, alpha
The color values are premultiplied with the alpha value.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GDK-MEMORY-B8G8R8A8:CAPS">GDK_MEMORY_B8G8R8A8</para></entry>
<entry role="enum_member_description"><para>4 bytes; for blue, green, red, alpha.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GDK-MEMORY-A8R8G8B8:CAPS">GDK_MEMORY_A8R8G8B8</para></entry>
<entry role="enum_member_description"><para>4 bytes; for alpha, red, green, blue.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GDK-MEMORY-R8G8B8A8:CAPS">GDK_MEMORY_R8G8B8A8</para></entry>
<entry role="enum_member_description"><para>4 bytes; for red, green, blue, alpha.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GDK-MEMORY-A8B8G8R8:CAPS">GDK_MEMORY_A8B8G8R8</para></entry>
<entry role="enum_member_description"><para>4 bytes; for alpha, blue, green, red.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GDK-MEMORY-R8G8B8:CAPS">GDK_MEMORY_R8G8B8</para></entry>
<entry role="enum_member_description"><para>3 bytes; for red, green, blue. The data is opaque.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GDK-MEMORY-B8G8R8:CAPS">GDK_MEMORY_B8G8R8</para></entry>
<entry role="enum_member_description"><para>3 bytes; for blue, green, red. The data is opaque.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GDK-MEMORY-N-FORMATS:CAPS">GDK_MEMORY_N_FORMATS</para></entry>
<entry role="enum_member_description"><para>The number of formats. This value will change as
more formats get added, so do not rely on its concrete integer.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="GDK-MEMORY-DEFAULT:CAPS" role="macro">
<title>GDK_MEMORY_DEFAULT</title>
<indexterm zone="GDK-MEMORY-DEFAULT:CAPS"><primary>GDK_MEMORY_DEFAULT</primary></indexterm>
<programlisting language="C">#define GDK_MEMORY_DEFAULT GDK_MEMORY_B8G8R8A8_PREMULTIPLIED
</programlisting>
<para>This is the default memory format used by GTK and is the format
provided by <link linkend="gdk-texture-download"><function>gdk_texture_download()</function></link>. It is equal to
<link linkend="CAIRO-FORMAT-ARGB32:CAPS"><literal>CAIRO_FORMAT_ARGB32</literal></link>.</para>
<para>Be aware that unlike the <link linkend="GdkMemoryFormat"><type>GdkMemoryFormat</type></link> values, this format is
different for different endianness.</para>
</refsect2>

</refsect1>
<refsect1 id="gdk4-Textures.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GdkTexture--height" role="property"><title>The <literal>“height”</literal> property</title>
<indexterm zone="GdkTexture--height"><primary>GdkTexture:height</primary></indexterm>
<programlisting>  “height”                   <link linkend="int"><type>int</type></link></programlisting>
<para>The height of the texture.</para>
<para>Owner: GdkTexture</para>
<para>Flags: Read / Write / Construct&#160;Only</para>
<para>Allowed values: &gt;= 1</para>
<para>Default value: 1</para>
</refsect2>
<refsect2 id="GdkTexture--width" role="property"><title>The <literal>“width”</literal> property</title>
<indexterm zone="GdkTexture--width"><primary>GdkTexture:width</primary></indexterm>
<programlisting>  “width”                    <link linkend="int"><type>int</type></link></programlisting>
<para>The width of the texture.</para>
<para>Owner: GdkTexture</para>
<para>Flags: Read / Write / Construct&#160;Only</para>
<para>Allowed values: &gt;= 1</para>
<para>Default value: 1</para>
</refsect2>

</refsect1>

</refentry>
