New upstream version 3.23.2
This commit is contained in:
@ -3,12 +3,12 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>GtkGLArea: GTK+ 3 Reference Manual</title>
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
|
||||
<link rel="home" href="index.html" title="GTK+ 3 Reference Manual">
|
||||
<link rel="up" href="MiscObjects.html" title="Miscellaneous">
|
||||
<link rel="prev" href="GtkDrawingArea.html" title="GtkDrawingArea">
|
||||
<link rel="next" href="GtkEventBox.html" title="GtkEventBox">
|
||||
<meta name="generator" content="GTK-Doc V1.27 (XML mode)">
|
||||
<meta name="generator" content="GTK-Doc V1.28 (XML mode)">
|
||||
<link rel="stylesheet" href="style.css" type="text/css">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
@ -53,7 +53,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="function_type">
|
||||
<a href="../html/GdkGLContext.html#GdkGLContext-struct"><span class="returnvalue">GdkGLContext</span></a> *
|
||||
<span class="returnvalue">GdkGLContext</span> *
|
||||
</td>
|
||||
<td class="function_name">
|
||||
<a class="link" href="GtkGLArea.html#gtk-gl-area-get-context" title="gtk_gl_area_get_context ()">gtk_gl_area_get_context</a> <span class="c_punctuation">()</span>
|
||||
@ -214,7 +214,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="property_type">
|
||||
<a href="../html/GdkGLContext.html#GdkGLContext-struct"><span class="type">GdkGLContext</span></a> *</td>
|
||||
<span class="type">GdkGLContext</span> *</td>
|
||||
<td class="property_name"><a class="link" href="GtkGLArea.html#GtkGLArea--context" title="The “context” property">context</a></td>
|
||||
<td class="property_flags">Read</td>
|
||||
</tr>
|
||||
@ -252,7 +252,7 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="signal_type">
|
||||
<a href="../html/GdkGLContext.html#GdkGLContext-struct"><span class="returnvalue">GdkGLContext</span></a>*</td>
|
||||
<span class="returnvalue">GdkGLContext</span>*</td>
|
||||
<td class="signal_name"><a class="link" href="GtkGLArea.html#GtkGLArea-create-context" title="The “create-context” signal">create-context</a></td>
|
||||
<td class="signal_flags">Run Last</td>
|
||||
</tr>
|
||||
@ -300,7 +300,7 @@
|
||||
<a name="GtkGLArea.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
|
||||
<p>
|
||||
GtkGLArea implements
|
||||
AtkImplementor and <a class="link" href="GtkBuildable.html" title="GtkBuildable">GtkBuildable</a>.</p>
|
||||
AtkImplementorIface and <a class="link" href="GtkBuildable.html" title="GtkBuildable">GtkBuildable</a>.</p>
|
||||
</div>
|
||||
<div class="refsect1">
|
||||
<a name="GtkGLArea.includes"></a><h2>Includes</h2>
|
||||
@ -310,7 +310,7 @@ GtkGLArea implements
|
||||
<div class="refsect1">
|
||||
<a name="GtkGLArea.description"></a><h2>Description</h2>
|
||||
<p><a class="link" href="GtkGLArea.html" title="GtkGLArea"><span class="type">GtkGLArea</span></a> is a widget that allows drawing with OpenGL.</p>
|
||||
<p><a class="link" href="GtkGLArea.html" title="GtkGLArea"><span class="type">GtkGLArea</span></a> sets up its own <a href="../html/GdkGLContext.html#GdkGLContext-struct"><span class="type">GdkGLContext</span></a> for the window it creates, and
|
||||
<p><a class="link" href="GtkGLArea.html" title="GtkGLArea"><span class="type">GtkGLArea</span></a> sets up its own <span class="type">GdkGLContext</span> for the window it creates, and
|
||||
creates a custom GL framebuffer that the widget will do GL rendering onto.
|
||||
It also ensures that this framebuffer is the default GL rendering target
|
||||
when rendering.</p>
|
||||
@ -318,89 +318,168 @@ when rendering.</p>
|
||||
or subclass <a class="link" href="GtkGLArea.html" title="GtkGLArea"><span class="type">GtkGLArea</span></a> and override the <em class="parameter"><code>GtkGLAreaClass.render()</code></em>
|
||||
virtual
|
||||
function.</p>
|
||||
<p>The <a class="link" href="GtkGLArea.html" title="GtkGLArea"><span class="type">GtkGLArea</span></a> widget ensures that the <a href="../html/GdkGLContext.html#GdkGLContext-struct"><span class="type">GdkGLContext</span></a> is associated with
|
||||
<p>The <a class="link" href="GtkGLArea.html" title="GtkGLArea"><span class="type">GtkGLArea</span></a> widget ensures that the <span class="type">GdkGLContext</span> is associated with
|
||||
the widget's drawing area, and it is kept updated when the size and
|
||||
position of the drawing area changes.</p>
|
||||
<div class="refsect3">
|
||||
<a name="id-1.3.19.5.10.6"></a><h4>Drawing with GtkGLArea</h4>
|
||||
<p>The simplest way to draw using OpenGL commands in a <a class="link" href="GtkGLArea.html" title="GtkGLArea"><span class="type">GtkGLArea</span></a> is to
|
||||
create a widget instance and connect to the <a class="link" href="GtkGLArea.html#GtkGLArea-render" title="The “render” signal"><span class="type">“render”</span></a> signal:</p>
|
||||
<div class="informalexample"><pre class="programlisting">
|
||||
// create a GtkGLArea instance
|
||||
GtkWidget *gl_area = gtk_gl_area_new ();
|
||||
<div class="informalexample">
|
||||
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="listing_lines" align="right"><pre>1
|
||||
2
|
||||
3
|
||||
4
|
||||
5</pre></td>
|
||||
<td class="listing_code"><pre class="programlisting"><span class="comment">// create a GtkGLArea instance</span>
|
||||
<span class="usertype">GtkWidget</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">gl_area </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GtkGLArea.html#gtk-gl-area-new">gtk_gl_area_new</a></span><span class="normal"> </span><span class="symbol">();</span>
|
||||
|
||||
<span class="comment">// connect to the "render" signal</span>
|
||||
<span class="function">g_signal_connect</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">gl_area</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"render"</span><span class="symbol">,</span><span class="normal"> </span><span class="function">G_CALLBACK</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">render</span><span class="symbol">),</span><span class="normal"> NULL</span><span class="symbol">);</span></pre></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
// connect to the "render" signal
|
||||
g_signal_connect (gl_area, "render", G_CALLBACK (render), NULL);
|
||||
</pre></div>
|
||||
<p></p>
|
||||
<p>The <code class="literal"><code class="function">render()</code></code> function will be called when the <a class="link" href="GtkGLArea.html" title="GtkGLArea"><span class="type">GtkGLArea</span></a> is ready
|
||||
for you to draw its content:</p>
|
||||
<div class="informalexample"><pre class="programlisting">
|
||||
static gboolean
|
||||
render (GtkGLArea *area, GdkGLContext *context)
|
||||
{
|
||||
// inside this function it's safe to use GL; the given
|
||||
// #GdkGLContext has been made current to the drawable
|
||||
// surface used by the #GtkGLArea and the viewport has
|
||||
// already been set to be the size of the allocation
|
||||
<div class="informalexample">
|
||||
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="listing_lines" align="right"><pre>1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
11
|
||||
12
|
||||
13
|
||||
14
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
19
|
||||
20</pre></td>
|
||||
<td class="listing_code"><pre class="programlisting"><span class="keyword">static</span><span class="normal"> gboolean</span>
|
||||
<span class="function">render</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">GtkGLArea</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">area</span><span class="symbol">,</span><span class="normal"> </span><span class="usertype">GdkGLContext</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">context</span><span class="symbol">)</span>
|
||||
<span class="cbracket">{</span>
|
||||
<span class="normal"> </span><span class="comment">// inside this function it's safe to use GL; the given</span>
|
||||
<span class="normal"> </span><span class="comment">// #GdkGLContext has been made current to the drawable</span>
|
||||
<span class="normal"> </span><span class="comment">// surface used by the #GtkGLArea and the viewport has</span>
|
||||
<span class="normal"> </span><span class="comment">// already been set to be the size of the allocation</span>
|
||||
|
||||
// we can start by clearing the buffer
|
||||
glClearColor (0, 0, 0, 0);
|
||||
glClear (GL_COLOR_BUFFER_BIT);
|
||||
<span class="normal"> </span><span class="comment">// we can start by clearing the buffer</span>
|
||||
<span class="normal"> </span><span class="function">glClearColor</span><span class="normal"> </span><span class="symbol">(</span><span class="number">0</span><span class="symbol">,</span><span class="normal"> </span><span class="number">0</span><span class="symbol">,</span><span class="normal"> </span><span class="number">0</span><span class="symbol">,</span><span class="normal"> </span><span class="number">0</span><span class="symbol">);</span>
|
||||
<span class="normal"> </span><span class="function">glClear</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">GL_COLOR_BUFFER_BIT</span><span class="symbol">);</span>
|
||||
|
||||
// draw your object
|
||||
draw_an_object ();
|
||||
<span class="normal"> </span><span class="comment">// draw your object</span>
|
||||
<span class="normal"> </span><span class="function">draw_an_object</span><span class="normal"> </span><span class="symbol">();</span>
|
||||
|
||||
<span class="normal"> </span><span class="comment">// we completed our drawing; the draw commands will be</span>
|
||||
<span class="normal"> </span><span class="comment">// flushed at the end of the signal emission chain, and</span>
|
||||
<span class="normal"> </span><span class="comment">// the buffers will be drawn on the window</span>
|
||||
<span class="normal"> </span><span class="keyword">return</span><span class="normal"> TRUE</span><span class="symbol">;</span>
|
||||
<span class="cbracket">}</span></pre></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
// we completed our drawing; the draw commands will be
|
||||
// flushed at the end of the signal emission chain, and
|
||||
// the buffers will be drawn on the window
|
||||
return TRUE;
|
||||
}
|
||||
</pre></div>
|
||||
<p></p>
|
||||
<p>If you need to initialize OpenGL state, e.g. buffer objects or
|
||||
shaders, you should use the <a class="link" href="GtkWidget.html#GtkWidget-realize" title="The “realize” signal"><span class="type">“realize”</span></a> signal; you
|
||||
can use the <a class="link" href="GtkWidget.html#GtkWidget-unrealize" title="The “unrealize” signal"><span class="type">“unrealize”</span></a> signal to clean up. Since the
|
||||
<a href="../html/GdkGLContext.html#GdkGLContext-struct"><span class="type">GdkGLContext</span></a> creation and initialization may fail, you will
|
||||
<span class="type">GdkGLContext</span> creation and initialization may fail, you will
|
||||
need to check for errors, using <a class="link" href="GtkGLArea.html#gtk-gl-area-get-error" title="gtk_gl_area_get_error ()"><code class="function">gtk_gl_area_get_error()</code></a>. An example
|
||||
of how to safely initialize the GL state is:</p>
|
||||
<div class="informalexample"><pre class="programlisting">
|
||||
static void
|
||||
on_realize (GtkGLarea *area)
|
||||
{
|
||||
// We need to make the context current if we want to
|
||||
// call GL API
|
||||
gtk_gl_area_make_current (area);
|
||||
<div class="informalexample">
|
||||
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="listing_lines" align="right"><pre>1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
11
|
||||
12
|
||||
13
|
||||
14
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
19
|
||||
20
|
||||
21
|
||||
22
|
||||
23
|
||||
24
|
||||
25
|
||||
26
|
||||
27
|
||||
28
|
||||
29
|
||||
30
|
||||
31
|
||||
32
|
||||
33</pre></td>
|
||||
<td class="listing_code"><pre class="programlisting"><span class="keyword">static</span><span class="normal"> </span><span class="type">void</span>
|
||||
<span class="function">on_realize</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">GtkGLarea</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">area</span><span class="symbol">)</span>
|
||||
<span class="cbracket">{</span>
|
||||
<span class="normal"> </span><span class="comment">// We need to make the context current if we want to</span>
|
||||
<span class="normal"> </span><span class="comment">// call GL API</span>
|
||||
<span class="normal"> </span><span class="function"><a href="GtkGLArea.html#gtk-gl-area-make-current">gtk_gl_area_make_current</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">area</span><span class="symbol">);</span>
|
||||
|
||||
// If there were errors during the initialization or
|
||||
// when trying to make the context current, this
|
||||
// function will return a #GError for you to catch
|
||||
if (gtk_gl_area_get_error (area) != NULL)
|
||||
return;
|
||||
<span class="normal"> </span><span class="comment">// If there were errors during the initialization or</span>
|
||||
<span class="normal"> </span><span class="comment">// when trying to make the context current, this</span>
|
||||
<span class="normal"> </span><span class="comment">// function will return a #GError for you to catch</span>
|
||||
<span class="normal"> </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="GtkGLArea.html#gtk-gl-area-get-error">gtk_gl_area_get_error</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">area</span><span class="symbol">)</span><span class="normal"> </span><span class="symbol">!=</span><span class="normal"> NULL</span><span class="symbol">)</span>
|
||||
<span class="normal"> </span><span class="keyword">return</span><span class="symbol">;</span>
|
||||
|
||||
// You can also use gtk_gl_area_set_error() in order
|
||||
// to show eventual initialization errors on the
|
||||
// GtkGLArea widget itself
|
||||
GError *internal_error = NULL;
|
||||
init_buffer_objects (&error);
|
||||
if (error != NULL)
|
||||
{
|
||||
gtk_gl_area_set_error (area, error);
|
||||
g_error_free (error);
|
||||
return;
|
||||
}
|
||||
<span class="normal"> </span><span class="comment">// You can also use gtk_gl_area_set_error() in order</span>
|
||||
<span class="normal"> </span><span class="comment">// to show eventual initialization errors on the</span>
|
||||
<span class="normal"> </span><span class="comment">// GtkGLArea widget itself</span>
|
||||
<span class="normal"> </span><span class="usertype">GError</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">internal_error </span><span class="symbol">=</span><span class="normal"> NULL</span><span class="symbol">;</span>
|
||||
<span class="normal"> </span><span class="function">init_buffer_objects</span><span class="normal"> </span><span class="symbol">(&</span><span class="normal">error</span><span class="symbol">);</span>
|
||||
<span class="normal"> </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">error </span><span class="symbol">!=</span><span class="normal"> NULL</span><span class="symbol">)</span>
|
||||
<span class="normal"> </span><span class="cbracket">{</span>
|
||||
<span class="normal"> </span><span class="function"><a href="GtkGLArea.html#gtk-gl-area-set-error">gtk_gl_area_set_error</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">area</span><span class="symbol">,</span><span class="normal"> error</span><span class="symbol">);</span>
|
||||
<span class="normal"> </span><span class="function">g_error_free</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">error</span><span class="symbol">);</span>
|
||||
<span class="normal"> </span><span class="keyword">return</span><span class="symbol">;</span>
|
||||
<span class="normal"> </span><span class="cbracket">}</span>
|
||||
|
||||
<span class="normal"> </span><span class="function">init_shaders</span><span class="normal"> </span><span class="symbol">(&</span><span class="normal">error</span><span class="symbol">);</span>
|
||||
<span class="normal"> </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">error </span><span class="symbol">!=</span><span class="normal"> NULL</span><span class="symbol">)</span>
|
||||
<span class="normal"> </span><span class="cbracket">{</span>
|
||||
<span class="normal"> </span><span class="function"><a href="GtkGLArea.html#gtk-gl-area-set-error">gtk_gl_area_set_error</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">area</span><span class="symbol">,</span><span class="normal"> error</span><span class="symbol">);</span>
|
||||
<span class="normal"> </span><span class="function">g_error_free</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">error</span><span class="symbol">);</span>
|
||||
<span class="normal"> </span><span class="keyword">return</span><span class="symbol">;</span>
|
||||
<span class="normal"> </span><span class="cbracket">}</span>
|
||||
<span class="cbracket">}</span></pre></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
init_shaders (&error);
|
||||
if (error != NULL)
|
||||
{
|
||||
gtk_gl_area_set_error (area, error);
|
||||
g_error_free (error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
</pre></div>
|
||||
<p></p>
|
||||
<p>If you need to change the options for creating the <a href="../html/GdkGLContext.html#GdkGLContext-struct"><span class="type">GdkGLContext</span></a>
|
||||
<p>If you need to change the options for creating the <span class="type">GdkGLContext</span>
|
||||
you should use the <a class="link" href="GtkGLArea.html#GtkGLArea-create-context" title="The “create-context” signal"><span class="type">“create-context”</span></a> signal.</p>
|
||||
</div>
|
||||
</div>
|
||||
@ -420,9 +499,9 @@ gtk_gl_area_new (<em class="parameter"><code><span class="type">void</span></cod
|
||||
<hr>
|
||||
<div class="refsect2">
|
||||
<a name="gtk-gl-area-get-context"></a><h3>gtk_gl_area_get_context ()</h3>
|
||||
<pre class="programlisting"><a href="../html/GdkGLContext.html#GdkGLContext-struct"><span class="returnvalue">GdkGLContext</span></a> *
|
||||
<pre class="programlisting"><span class="returnvalue">GdkGLContext</span> *
|
||||
gtk_gl_area_get_context (<em class="parameter"><code><a class="link" href="GtkGLArea.html" title="GtkGLArea"><span class="type">GtkGLArea</span></a> *area</code></em>);</pre>
|
||||
<p>Retrieves the <a href="../html/GdkGLContext.html#GdkGLContext-struct"><span class="type">GdkGLContext</span></a> used by <em class="parameter"><code>area</code></em>
|
||||
<p>Retrieves the <span class="type">GdkGLContext</span> used by <em class="parameter"><code>area</code></em>
|
||||
.</p>
|
||||
<div class="refsect3">
|
||||
<a name="gtk-gl-area-get-context.parameters"></a><h4>Parameters</h4>
|
||||
@ -441,7 +520,7 @@ gtk_gl_area_get_context (<em class="parameter"><code><a class="link" href="GtkGL
|
||||
</div>
|
||||
<div class="refsect3">
|
||||
<a name="gtk-gl-area-get-context.returns"></a><h4>Returns</h4>
|
||||
<p>the <a href="../html/GdkGLContext.html#GdkGLContext-struct"><span class="type">GdkGLContext</span></a>. </p>
|
||||
<p>the <span class="type">GdkGLContext</span>. </p>
|
||||
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
|
||||
</div>
|
||||
<p class="since">Since: <a class="link" href="api-index-3-16.html#api-index-3.16">3.16</a></p>
|
||||
@ -451,7 +530,7 @@ gtk_gl_area_get_context (<em class="parameter"><code><a class="link" href="GtkGL
|
||||
<a name="gtk-gl-area-make-current"></a><h3>gtk_gl_area_make_current ()</h3>
|
||||
<pre class="programlisting"><span class="returnvalue">void</span>
|
||||
gtk_gl_area_make_current (<em class="parameter"><code><a class="link" href="GtkGLArea.html" title="GtkGLArea"><span class="type">GtkGLArea</span></a> *area</code></em>);</pre>
|
||||
<p>Ensures that the <a href="../html/GdkGLContext.html#GdkGLContext-struct"><span class="type">GdkGLContext</span></a> used by <em class="parameter"><code>area</code></em>
|
||||
<p>Ensures that the <span class="type">GdkGLContext</span> used by <em class="parameter"><code>area</code></em>
|
||||
is associated with
|
||||
the <a class="link" href="GtkGLArea.html" title="GtkGLArea"><span class="type">GtkGLArea</span></a>.</p>
|
||||
<p>This function is automatically called before emitting the
|
||||
@ -936,7 +1015,7 @@ gtk_gl_area_set_use_es (<em class="parameter"><code><a class="link" href="GtkGLA
|
||||
<em class="parameter"><code><span class="type">gboolean</span> use_es</code></em>);</pre>
|
||||
<p>Sets whether the <em class="parameter"><code>area</code></em>
|
||||
should create an OpenGL or an OpenGL ES context.</p>
|
||||
<p>You should check the capabilities of the <a href="../html/GdkGLContext.html#GdkGLContext-struct"><span class="type">GdkGLContext</span></a> before drawing
|
||||
<p>You should check the capabilities of the <span class="type">GdkGLContext</span> before drawing
|
||||
with either API.</p>
|
||||
<div class="refsect3">
|
||||
<a name="gtk-gl-area-set-use-es.parameters"></a><h4>Parameters</h4>
|
||||
@ -1062,9 +1141,9 @@ to redraw.</p>
|
||||
<hr>
|
||||
<div class="refsect2">
|
||||
<a name="GtkGLArea--context"></a><h3>The <code class="literal">“context”</code> property</h3>
|
||||
<pre class="programlisting"> “context” <a href="../html/GdkGLContext.html#GdkGLContext-struct"><span class="type">GdkGLContext</span></a> *</pre>
|
||||
<p>The <a href="../html/GdkGLContext.html#GdkGLContext-struct"><span class="type">GdkGLContext</span></a> used by the <a class="link" href="GtkGLArea.html" title="GtkGLArea"><span class="type">GtkGLArea</span></a> widget.</p>
|
||||
<p>The <a class="link" href="GtkGLArea.html" title="GtkGLArea"><span class="type">GtkGLArea</span></a> widget is responsible for creating the <a href="../html/GdkGLContext.html#GdkGLContext-struct"><span class="type">GdkGLContext</span></a>
|
||||
<pre class="programlisting"> “context” <span class="type">GdkGLContext</span> *</pre>
|
||||
<p>The <span class="type">GdkGLContext</span> used by the <a class="link" href="GtkGLArea.html" title="GtkGLArea"><span class="type">GtkGLArea</span></a> widget.</p>
|
||||
<p>The <a class="link" href="GtkGLArea.html" title="GtkGLArea"><span class="type">GtkGLArea</span></a> widget is responsible for creating the <span class="type">GdkGLContext</span>
|
||||
instance. If you need to render with other kinds of buffers (stencil,
|
||||
depth, etc), use render buffers.</p>
|
||||
<p>Flags: Read</p>
|
||||
@ -1107,9 +1186,9 @@ target framebuffer.</p>
|
||||
<div class="refsect2">
|
||||
<a name="GtkGLArea--use-es"></a><h3>The <code class="literal">“use-es”</code> property</h3>
|
||||
<pre class="programlisting"> “use-es” <span class="type">gboolean</span></pre>
|
||||
<p>If set to <code class="literal">TRUE</code> the widget will try to create a <a href="../html/GdkGLContext.html#GdkGLContext-struct"><span class="type">GdkGLContext</span></a> using
|
||||
<p>If set to <code class="literal">TRUE</code> the widget will try to create a <span class="type">GdkGLContext</span> using
|
||||
OpenGL ES instead of OpenGL.</p>
|
||||
<p>See also: <a href="../html/GdkGLContext.html#gdk-gl-context-set-use-es"><code class="function">gdk_gl_context_set_use_es()</code></a></p>
|
||||
<p>See also: <code class="function">gdk_gl_context_set_use_es()</code></p>
|
||||
<p>Flags: Read / Write</p>
|
||||
<p>Default value: FALSE</p>
|
||||
<p class="since">Since: <a class="link" href="api-index-3-22.html#api-index-3.22">3.22</a></p>
|
||||
@ -1119,7 +1198,7 @@ OpenGL ES instead of OpenGL.</p>
|
||||
<a name="GtkGLArea.signal-details"></a><h2>Signal Details</h2>
|
||||
<div class="refsect2">
|
||||
<a name="GtkGLArea-create-context"></a><h3>The <code class="literal">“create-context”</code> signal</h3>
|
||||
<pre class="programlisting"><a href="../html/GdkGLContext.html#GdkGLContext-struct"><span class="returnvalue">GdkGLContext</span></a>*
|
||||
<pre class="programlisting"><span class="returnvalue">GdkGLContext</span>*
|
||||
user_function (<a class="link" href="GtkGLArea.html" title="GtkGLArea"><span class="type">GtkGLArea</span></a> *area,
|
||||
<span class="type">gpointer</span> user_data)</pre>
|
||||
<p>The ::create-context signal is emitted when the widget is being
|
||||
@ -1159,7 +1238,7 @@ of how the construction failed.</p>
|
||||
</div>
|
||||
<div class="refsect3">
|
||||
<a name="GtkGLArea-create-context.returns"></a><h4>Returns</h4>
|
||||
<p>a newly created <a href="../html/GdkGLContext.html#GdkGLContext-struct"><span class="type">GdkGLContext</span></a>;
|
||||
<p>a newly created <span class="type">GdkGLContext</span>;
|
||||
the <a class="link" href="GtkGLArea.html" title="GtkGLArea"><span class="type">GtkGLArea</span></a> widget will take ownership of the returned value. </p>
|
||||
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
|
||||
</div>
|
||||
@ -1171,7 +1250,7 @@ the <a class="link" href="GtkGLArea.html" title="GtkGLArea"><span class="type">G
|
||||
<a name="GtkGLArea-render"></a><h3>The <code class="literal">“render”</code> signal</h3>
|
||||
<pre class="programlisting"><span class="returnvalue">gboolean</span>
|
||||
user_function (<a class="link" href="GtkGLArea.html" title="GtkGLArea"><span class="type">GtkGLArea</span></a> *area,
|
||||
<a href="../html/GdkGLContext.html#GdkGLContext-struct"><span class="type">GdkGLContext</span></a> *context,
|
||||
<span class="type">GdkGLContext</span> *context,
|
||||
<span class="type">gpointer</span> user_data)</pre>
|
||||
<p>The ::render signal is emitted every time the contents
|
||||
of the <a class="link" href="GtkGLArea.html" title="GtkGLArea"><span class="type">GtkGLArea</span></a> should be redrawn.</p>
|
||||
@ -1195,7 +1274,7 @@ and the buffers are painted to the window once the emission terminates.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="parameter_name"><p>context</p></td>
|
||||
<td class="parameter_description"><p>the <a href="../html/GdkGLContext.html#GdkGLContext-struct"><span class="type">GdkGLContext</span></a> used by <em class="parameter"><code>area</code></em>
|
||||
<td class="parameter_description"><p>the <span class="type">GdkGLContext</span> used by <em class="parameter"><code>area</code></em>
|
||||
</p></td>
|
||||
<td class="parameter_annotations"> </td>
|
||||
</tr>
|
||||
@ -1268,6 +1347,6 @@ is emitted.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<hr>Generated by GTK-Doc V1.27</div>
|
||||
<hr>Generated by GTK-Doc V1.28</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user