<?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="GdkGLContext">
<refmeta>
<refentrytitle role="top_of_page" id="GdkGLContext.top_of_page">GdkGLContext</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GDK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GdkGLContext</refname>
<refpurpose>OpenGL draw context</refpurpose>
</refnamediv>

<refsect1 id="GdkGLContext.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="GdkDisplay"><returnvalue>GdkDisplay</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gdk-gl-context-get-display">gdk_gl_context_get_display</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkSurface"><returnvalue>GdkSurface</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gdk-gl-context-get-surface">gdk_gl_context_get_surface</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkGLContext"><returnvalue>GdkGLContext</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gdk-gl-context-get-shared-context">gdk_gl_context_get_shared_context</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-context-get-version">gdk_gl_context_get_version</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-context-set-required-version">gdk_gl_context_set_required_version</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-context-get-required-version">gdk_gl_context_get_required_version</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-context-set-debug-enabled">gdk_gl_context_set_debug_enabled</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-gl-context-get-debug-enabled">gdk_gl_context_get_debug_enabled</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-context-set-forward-compatible">gdk_gl_context_set_forward_compatible</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-gl-context-get-forward-compatible">gdk_gl_context_get_forward_compatible</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-context-set-use-es">gdk_gl_context_set_use_es</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-gl-context-get-use-es">gdk_gl_context_get_use_es</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-gl-context-is-legacy">gdk_gl_context_is_legacy</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-gl-context-realize">gdk_gl_context_realize</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-context-make-current">gdk_gl_context_make_current</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkGLContext"><returnvalue>GdkGLContext</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gdk-gl-context-get-current">gdk_gl_context_get_current</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-context-clear-current">gdk_gl_context_clear_current</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GdkGLContext.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="GdkGLContext"><type>GdkGLContext</type></link>&#160;*</entry><entry role="property_name"><link linkend="GdkGLContext--shared-context">shared-context</link></entry><entry role="property_flags">Read / Write / Construct&#160;Only</entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GdkGLContext.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="GdkGLContext-struct">GdkGLContext</link></entry></row>


<row><entry role="datatype_keyword">enum</entry><entry role="function_name"><link linkend="GdkGLError">GdkGLError</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GdkGLContext.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> <link linkend="GdkDrawContext">GdkDrawContext</link>
        <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> GdkGLContext
</screen>
</refsect1>

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

<refsect1 id="GdkGLContext.description" role="desc">
<title role="desc.title">Description</title>
<para><link linkend="GdkGLContext"><type>GdkGLContext</type></link> is an object representing the platform-specific
OpenGL draw context.</para>
<para><link linkend="GdkGLContexts"><type>GdkGLContexts</type></link> are created for a <link linkend="GdkSurface"><type>GdkSurface</type></link> using
<link linkend="gdk-surface-create-gl-context"><function>gdk_surface_create_gl_context()</function></link>, and the context will match the
the characteristics of the surface.</para>
<para>A <link linkend="GdkGLContext"><type>GdkGLContext</type></link> is not tied to any particular normal framebuffer.
For instance, it cannot draw to the <link linkend="GdkSurface"><type>GdkSurface</type></link> back buffer. The GDK
repaint system is in full control of the painting to that. Instead,
you can create render buffers or textures and use <link linkend="gdk-cairo-draw-from-gl"><function>gdk_cairo_draw_from_gl()</function></link>
in the draw function of your widget to draw them. Then GDK will handle
the integration of your rendering with that of other widgets.</para>
<para>Support for <link linkend="GdkGLContext"><type>GdkGLContext</type></link> is platform-specific, context creation
can fail, returning <link linkend="NULL:CAPS"><literal>NULL</literal></link> context.</para>
<para>A <link linkend="GdkGLContext"><type>GdkGLContext</type></link> has to be made "current" in order to start using
it, otherwise any OpenGL call will be ignored.</para>
<refsect3><title>Creating a new OpenGL context</title><para>In order to create a new <link linkend="GdkGLContext"><type>GdkGLContext</type></link> instance you need a
<link linkend="GdkSurface"><type>GdkSurface</type></link>, which you typically get during the realize call
of a widget.</para>
<para>A <link linkend="GdkGLContext"><type>GdkGLContext</type></link> is not realized until either <link linkend="gdk-gl-context-make-current"><function>gdk_gl_context_make_current()</function></link>,
or until it is realized using <link linkend="gdk-gl-context-realize"><function>gdk_gl_context_realize()</function></link>. It is possible to
specify details of the GL context like the OpenGL version to be used, or
whether the GL context should have extra state validation enabled after
calling <link linkend="gdk-surface-create-gl-context"><function>gdk_surface_create_gl_context()</function></link> by calling <link linkend="gdk-gl-context-realize"><function>gdk_gl_context_realize()</function></link>.
If the realization fails you have the option to change the settings of the
<link linkend="GdkGLContext"><type>GdkGLContext</type></link> and try again.</para>
</refsect3>
<refsect3><title>Using a GdkGLContext</title><para>You will need to make the <link linkend="GdkGLContext"><type>GdkGLContext</type></link> the current context
before issuing OpenGL calls; the system sends OpenGL commands to
whichever context is current. It is possible to have multiple
contexts, so you always need to ensure that the one which you
want to draw with is the current one before issuing commands:</para>
<informalexample><programlisting role="example"><![CDATA[
  gdk_gl_context_make_current (context);
]]></programlisting></informalexample>
<para></para>
<para>You can now perform your drawing using OpenGL commands.</para>
<para>You can check which <link linkend="GdkGLContext"><type>GdkGLContext</type></link> is the current one by using
<link linkend="gdk-gl-context-get-current"><function>gdk_gl_context_get_current()</function></link>; you can also unset any <link linkend="GdkGLContext"><type>GdkGLContext</type></link>
that is currently set by calling <link linkend="gdk-gl-context-clear-current"><function>gdk_gl_context_clear_current()</function></link>.</para>
</refsect3>

</refsect1>
<refsect1 id="GdkGLContext.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gdk-gl-context-get-display" role="function">
<title>gdk_gl_context_get_display&#160;()</title>
<indexterm zone="gdk-gl-context-get-display"><primary>gdk_gl_context_get_display</primary></indexterm>
<programlisting language="C"><link linkend="GdkDisplay"><returnvalue>GdkDisplay</returnvalue></link>&#160;*
gdk_gl_context_get_display (<parameter><link linkend="GdkGLContext"><type>GdkGLContext</type></link> *context</parameter>);</programlisting>
<para>Retrieves the <link linkend="GdkDisplay"><type>GdkDisplay</type></link> the <parameter>context</parameter>
 is created for</para>
<refsect3 id="gdk-gl-context-get-display.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>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-gl-context-get-display.returns" role="returns">
<title>Returns</title>
<para>a <link linkend="GdkDisplay"><type>GdkDisplay</type></link> or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>][<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gdk-gl-context-get-surface" role="function">
<title>gdk_gl_context_get_surface&#160;()</title>
<indexterm zone="gdk-gl-context-get-surface"><primary>gdk_gl_context_get_surface</primary></indexterm>
<programlisting language="C"><link linkend="GdkSurface"><returnvalue>GdkSurface</returnvalue></link>&#160;*
gdk_gl_context_get_surface (<parameter><link linkend="GdkGLContext"><type>GdkGLContext</type></link> *context</parameter>);</programlisting>
<para>Retrieves the <link linkend="GdkSurface"><type>GdkSurface</type></link> used by the <parameter>context</parameter>
.</para>
<refsect3 id="gdk-gl-context-get-surface.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>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-gl-context-get-surface.returns" role="returns">
<title>Returns</title>
<para>a <link linkend="GdkSurface"><type>GdkSurface</type></link> or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>][<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gdk-gl-context-get-shared-context" role="function">
<title>gdk_gl_context_get_shared_context&#160;()</title>
<indexterm zone="gdk-gl-context-get-shared-context"><primary>gdk_gl_context_get_shared_context</primary></indexterm>
<programlisting language="C"><link linkend="GdkGLContext"><returnvalue>GdkGLContext</returnvalue></link>&#160;*
gdk_gl_context_get_shared_context (<parameter><link linkend="GdkGLContext"><type>GdkGLContext</type></link> *context</parameter>);</programlisting>
<para>Retrieves the <link linkend="GdkGLContext"><type>GdkGLContext</type></link> that this <parameter>context</parameter>
 share data with.</para>
<refsect3 id="gdk-gl-context-get-shared-context.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>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-gl-context-get-shared-context.returns" role="returns">
<title>Returns</title>
<para>a <link linkend="GdkGLContext"><type>GdkGLContext</type></link> or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>][<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gdk-gl-context-get-version" role="function">
<title>gdk_gl_context_get_version&#160;()</title>
<indexterm zone="gdk-gl-context-get-version"><primary>gdk_gl_context_get_version</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gdk_gl_context_get_version (<parameter><link linkend="GdkGLContext"><type>GdkGLContext</type></link> *context</parameter>,
                            <parameter><link linkend="int"><type>int</type></link> *major</parameter>,
                            <parameter><link linkend="int"><type>int</type></link> *minor</parameter>);</programlisting>
<para>Retrieves the OpenGL version of the <parameter>context</parameter>
.</para>
<para>The <parameter>context</parameter>
 must be realized prior to calling this function.</para>
<refsect3 id="gdk-gl-context-get-version.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>major</para></entry>
<entry role="parameter_description"><para>return location for the major version. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>minor</para></entry>
<entry role="parameter_description"><para>return location for the minor version. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gdk-gl-context-set-required-version" role="function">
<title>gdk_gl_context_set_required_version&#160;()</title>
<indexterm zone="gdk-gl-context-set-required-version"><primary>gdk_gl_context_set_required_version</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gdk_gl_context_set_required_version (<parameter><link linkend="GdkGLContext"><type>GdkGLContext</type></link> *context</parameter>,
                                     <parameter><link linkend="int"><type>int</type></link> major</parameter>,
                                     <parameter><link linkend="int"><type>int</type></link> minor</parameter>);</programlisting>
<para>Sets the major and minor version of OpenGL to request.</para>
<para>Setting <parameter>major</parameter>
 and <parameter>minor</parameter>
 to zero will use the default values.</para>
<para>The <link linkend="GdkGLContext"><type>GdkGLContext</type></link> must not be realized or made current prior to calling
this function.</para>
<refsect3 id="gdk-gl-context-set-required-version.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>major</para></entry>
<entry role="parameter_description"><para>the major version to request</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>minor</para></entry>
<entry role="parameter_description"><para>the minor version to request</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gdk-gl-context-get-required-version" role="function">
<title>gdk_gl_context_get_required_version&#160;()</title>
<indexterm zone="gdk-gl-context-get-required-version"><primary>gdk_gl_context_get_required_version</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gdk_gl_context_get_required_version (<parameter><link linkend="GdkGLContext"><type>GdkGLContext</type></link> *context</parameter>,
                                     <parameter><link linkend="int"><type>int</type></link> *major</parameter>,
                                     <parameter><link linkend="int"><type>int</type></link> *minor</parameter>);</programlisting>
<para>Retrieves the major and minor version requested by calling
<link linkend="gdk-gl-context-set-required-version"><function>gdk_gl_context_set_required_version()</function></link>.</para>
<refsect3 id="gdk-gl-context-get-required-version.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>major</para></entry>
<entry role="parameter_description"><para>return location for the major version to request. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>minor</para></entry>
<entry role="parameter_description"><para>return location for the minor version to request. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gdk-gl-context-set-debug-enabled" role="function">
<title>gdk_gl_context_set_debug_enabled&#160;()</title>
<indexterm zone="gdk-gl-context-set-debug-enabled"><primary>gdk_gl_context_set_debug_enabled</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gdk_gl_context_set_debug_enabled (<parameter><link linkend="GdkGLContext"><type>GdkGLContext</type></link> *context</parameter>,
                                  <parameter><link linkend="gboolean"><type>gboolean</type></link> enabled</parameter>);</programlisting>
<para>Sets whether the <link linkend="GdkGLContext"><type>GdkGLContext</type></link> should perform extra validations and
run time checking. This is useful during development, but has
additional overhead.</para>
<para>The <link linkend="GdkGLContext"><type>GdkGLContext</type></link> must not be realized or made current prior to
calling this function.</para>
<refsect3 id="gdk-gl-context-set-debug-enabled.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>enabled</para></entry>
<entry role="parameter_description"><para>whether to enable debugging in the context</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gdk-gl-context-get-debug-enabled" role="function">
<title>gdk_gl_context_get_debug_enabled&#160;()</title>
<indexterm zone="gdk-gl-context-get-debug-enabled"><primary>gdk_gl_context_get_debug_enabled</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gdk_gl_context_get_debug_enabled (<parameter><link linkend="GdkGLContext"><type>GdkGLContext</type></link> *context</parameter>);</programlisting>
<para>Retrieves the value set using <link linkend="gdk-gl-context-set-debug-enabled"><function>gdk_gl_context_set_debug_enabled()</function></link>.</para>
<refsect3 id="gdk-gl-context-get-debug-enabled.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>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-gl-context-get-debug-enabled.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if debugging is enabled</para>
</refsect3></refsect2>
<refsect2 id="gdk-gl-context-set-forward-compatible" role="function">
<title>gdk_gl_context_set_forward_compatible&#160;()</title>
<indexterm zone="gdk-gl-context-set-forward-compatible"><primary>gdk_gl_context_set_forward_compatible</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gdk_gl_context_set_forward_compatible (<parameter><link linkend="GdkGLContext"><type>GdkGLContext</type></link> *context</parameter>,
                                       <parameter><link linkend="gboolean"><type>gboolean</type></link> compatible</parameter>);</programlisting>
<para>Sets whether the <link linkend="GdkGLContext"><type>GdkGLContext</type></link> should be forward compatible.</para>
<para>Forward compatible contexts must not support OpenGL functionality that
has been marked as deprecated in the requested version; non-forward
compatible contexts, on the other hand, must support both deprecated and
non deprecated functionality.</para>
<para>The <link linkend="GdkGLContext"><type>GdkGLContext</type></link> must not be realized or made current prior to calling
this function.</para>
<refsect3 id="gdk-gl-context-set-forward-compatible.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>compatible</para></entry>
<entry role="parameter_description"><para>whether the context should be forward compatible</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gdk-gl-context-get-forward-compatible" role="function">
<title>gdk_gl_context_get_forward_compatible&#160;()</title>
<indexterm zone="gdk-gl-context-get-forward-compatible"><primary>gdk_gl_context_get_forward_compatible</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gdk_gl_context_get_forward_compatible (<parameter><link linkend="GdkGLContext"><type>GdkGLContext</type></link> *context</parameter>);</programlisting>
<para>Retrieves the value set using <link linkend="gdk-gl-context-set-forward-compatible"><function>gdk_gl_context_set_forward_compatible()</function></link>.</para>
<refsect3 id="gdk-gl-context-get-forward-compatible.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>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-gl-context-get-forward-compatible.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the context should be forward compatible</para>
</refsect3></refsect2>
<refsect2 id="gdk-gl-context-set-use-es" role="function">
<title>gdk_gl_context_set_use_es&#160;()</title>
<indexterm zone="gdk-gl-context-set-use-es"><primary>gdk_gl_context_set_use_es</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gdk_gl_context_set_use_es (<parameter><link linkend="GdkGLContext"><type>GdkGLContext</type></link> *context</parameter>,
                           <parameter><link linkend="int"><type>int</type></link> use_es</parameter>);</programlisting>
<para>Requests that GDK create an OpenGL ES context instead of an OpenGL one,
if the platform and windowing system allows it.</para>
<para>The <parameter>context</parameter>
 must not have been realized.</para>
<para>By default, GDK will attempt to automatically detect whether the
underlying GL implementation is OpenGL or OpenGL ES once the <parameter>context</parameter>

is realized.</para>
<para>You should check the return value of <link linkend="gdk-gl-context-get-use-es"><function>gdk_gl_context_get_use_es()</function></link> after
calling <link linkend="gdk-gl-context-realize"><function>gdk_gl_context_realize()</function></link> to decide whether to use the OpenGL or
OpenGL ES API, extensions, or shaders.</para>
<refsect3 id="gdk-gl-context-set-use-es.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>use_es</para></entry>
<entry role="parameter_description"><para>whether the context should use OpenGL ES instead of OpenGL,
or -1 to allow auto-detection</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gdk-gl-context-get-use-es" role="function">
<title>gdk_gl_context_get_use_es&#160;()</title>
<indexterm zone="gdk-gl-context-get-use-es"><primary>gdk_gl_context_get_use_es</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gdk_gl_context_get_use_es (<parameter><link linkend="GdkGLContext"><type>GdkGLContext</type></link> *context</parameter>);</programlisting>
<para>Checks whether the <parameter>context</parameter>
 is using an OpenGL or OpenGL ES profile.</para>
<refsect3 id="gdk-gl-context-get-use-es.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>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-gl-context-get-use-es.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the <link linkend="GdkGLContext"><type>GdkGLContext</type></link> is using an OpenGL ES profile</para>
</refsect3></refsect2>
<refsect2 id="gdk-gl-context-is-legacy" role="function">
<title>gdk_gl_context_is_legacy&#160;()</title>
<indexterm zone="gdk-gl-context-is-legacy"><primary>gdk_gl_context_is_legacy</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gdk_gl_context_is_legacy (<parameter><link linkend="GdkGLContext"><type>GdkGLContext</type></link> *context</parameter>);</programlisting>
<para>Whether the <link linkend="GdkGLContext"><type>GdkGLContext</type></link> is in legacy mode or not.</para>
<para>The <link linkend="GdkGLContext"><type>GdkGLContext</type></link> must be realized before calling this function.</para>
<para>When realizing a GL context, GDK will try to use the OpenGL 3.2 core
profile; this profile removes all the OpenGL API that was deprecated
prior to the 3.2 version of the specification. If the realization is
successful, this function will return <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>.</para>
<para>If the underlying OpenGL implementation does not support core profiles,
GDK will fall back to a pre-3.2 compatibility profile, and this function
will return <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>.</para>
<para>You can use the value returned by this function to decide which kind
of OpenGL API to use, or whether to do extension discovery, or what
kind of shader programs to load.</para>
<refsect3 id="gdk-gl-context-is-legacy.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>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-gl-context-is-legacy.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the GL context is in legacy mode</para>
</refsect3></refsect2>
<refsect2 id="gdk-gl-context-realize" role="function">
<title>gdk_gl_context_realize&#160;()</title>
<indexterm zone="gdk-gl-context-realize"><primary>gdk_gl_context_realize</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gdk_gl_context_realize (<parameter><link linkend="GdkGLContext"><type>GdkGLContext</type></link> *context</parameter>,
                        <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Realizes the given <link linkend="GdkGLContext"><type>GdkGLContext</type></link>.</para>
<para>It is safe to call this function on a realized <link linkend="GdkGLContext"><type>GdkGLContext</type></link>.</para>
<refsect3 id="gdk-gl-context-realize.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>error</para></entry>
<entry role="parameter_description"><para>return location for a <link linkend="GError"><type>GError</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-gl-context-realize.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the context is realized</para>
</refsect3></refsect2>
<refsect2 id="gdk-gl-context-make-current" role="function">
<title>gdk_gl_context_make_current&#160;()</title>
<indexterm zone="gdk-gl-context-make-current"><primary>gdk_gl_context_make_current</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gdk_gl_context_make_current (<parameter><link linkend="GdkGLContext"><type>GdkGLContext</type></link> *context</parameter>);</programlisting>
<para>Makes the <parameter>context</parameter>
 the current one.</para>
<refsect3 id="gdk-gl-context-make-current.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>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gdk-gl-context-get-current" role="function">
<title>gdk_gl_context_get_current&#160;()</title>
<indexterm zone="gdk-gl-context-get-current"><primary>gdk_gl_context_get_current</primary></indexterm>
<programlisting language="C"><link linkend="GdkGLContext"><returnvalue>GdkGLContext</returnvalue></link>&#160;*
gdk_gl_context_get_current (<parameter><type>void</type></parameter>);</programlisting>
<para>Retrieves the current <link linkend="GdkGLContext"><type>GdkGLContext</type></link>.</para>
<refsect3 id="gdk-gl-context-get-current.returns" role="returns">
<title>Returns</title>
<para>the current <link linkend="GdkGLContext"><type>GdkGLContext</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>][<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gdk-gl-context-clear-current" role="function">
<title>gdk_gl_context_clear_current&#160;()</title>
<indexterm zone="gdk-gl-context-clear-current"><primary>gdk_gl_context_clear_current</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gdk_gl_context_clear_current (<parameter><type>void</type></parameter>);</programlisting>
<para>Clears the current <link linkend="GdkGLContext"><type>GdkGLContext</type></link>.</para>
<para>Any OpenGL call after this function returns will be ignored
until <link linkend="gdk-gl-context-make-current"><function>gdk_gl_context_make_current()</function></link> is called.</para>
</refsect2>

</refsect1>
<refsect1 id="GdkGLContext.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="GdkGLContext-struct" role="struct">
<title>GdkGLContext</title>
<indexterm zone="GdkGLContext-struct"><primary>GdkGLContext</primary></indexterm>
<programlisting language="C">typedef struct _GdkGLContext GdkGLContext;</programlisting>
<para>The GdkGLContext struct contains only private fields and
should not be accessed directly.</para>
</refsect2>
<refsect2 id="GdkGLError" role="enum">
<title>enum GdkGLError</title>
<indexterm zone="GdkGLError"><primary>GdkGLError</primary></indexterm>
<para>Error enumeration for <link linkend="GdkGLContext"><type>GdkGLContext</type></link>.</para>
<refsect3 id="GdkGLError.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-GL-ERROR-NOT-AVAILABLE:CAPS">GDK_GL_ERROR_NOT_AVAILABLE</para></entry>
<entry role="enum_member_description"><para>OpenGL support is not available</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GDK-GL-ERROR-UNSUPPORTED-FORMAT:CAPS">GDK_GL_ERROR_UNSUPPORTED_FORMAT</para></entry>
<entry role="enum_member_description"><para>The requested visual format is not supported</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GDK-GL-ERROR-UNSUPPORTED-PROFILE:CAPS">GDK_GL_ERROR_UNSUPPORTED_PROFILE</para></entry>
<entry role="enum_member_description"><para>The requested profile is not supported</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GDK-GL-ERROR-COMPILATION-FAILED:CAPS">GDK_GL_ERROR_COMPILATION_FAILED</para></entry>
<entry role="enum_member_description"><para>The shader compilation failed</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GDK-GL-ERROR-LINK-FAILED:CAPS">GDK_GL_ERROR_LINK_FAILED</para></entry>
<entry role="enum_member_description"><para>The shader linking failed</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>

</refsect1>
<refsect1 id="GdkGLContext.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GdkGLContext--shared-context" role="property"><title>The <literal>“shared-context”</literal> property</title>
<indexterm zone="GdkGLContext--shared-context"><primary>GdkGLContext:shared-context</primary></indexterm>
<programlisting>  “shared-context”           <link linkend="GdkGLContext"><type>GdkGLContext</type></link>&#160;*</programlisting>
<para>The <link linkend="GdkGLContext"><type>GdkGLContext</type></link> that this context is sharing data with, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></para>
<para>Owner: GdkGLContext</para>
<para>Flags: Read / Write / Construct&#160;Only</para>
</refsect2>

</refsect1>

</refentry>
