1
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Initialization</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><meta name="generator" content="GTK-Doc V1.1 (XML mode)"><style type="text/css">
2
.synopsis, .classsynopsis {
4
border: solid 1px #aaaaaa;
9
border: solid 1px #aaaaff;
18
border: solid 1px #ffaaaa;
25
.navigation a:visited {
31
</style><link rel="home" href="index.html" title="GtkGLExt Reference Manual"><link rel="up" href="GtkGLExt-API.html" title="Part�III.�GtkGLExt API Reference"><link rel="previous" href="GtkGLExt-API.html" title="Part�III.�GtkGLExt API Reference"><link rel="next" href="gtkglext-gtkglwidget.html" title="OpenGL-Capable Widget"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="GtkGLExt-API.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="GtkGLExt-API.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td><th width="100%" align="center">GtkGLExt Reference Manual</th><td><a accesskey="n" href="gtkglext-gtkglwidget.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr></table><div class="refentry" lang="en"><a name="gtkglext-gtkglinit"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">Initialization</span></h2><p>Initialization — Library initialization functions</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
33
#include <gtk/gtkgl.h>
36
void <a href="gtkglext-gtkglinit.html#gtk-gl-init">gtk_gl_init</a> (int *argc,
38
gboolean <a href="gtkglext-gtkglinit.html#gtk-gl-init-check">gtk_gl_init_check</a> (int *argc,
40
gboolean <a href="gtkglext-gtkglinit.html#gtk-gl-parse-args">gtk_gl_parse_args</a> (int *argc,
42
</pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>
44
</p></div><div class="refsect1" lang="en"><h2>Details</h2><div class="refsect2" lang="en"><h3><a name="gtk-gl-init"></a>gtk_gl_init ()</h3><pre class="programlisting">void gtk_gl_init (int *argc,
45
char ***argv);</pre><p>
46
Call this function before using any other GtkGLExt functions in your
47
applications. It will initialize everything needed to operate the library
48
and parses some standard command line options. <i class="parameter"><tt>argc</tt></i> and
49
<i class="parameter"><tt>argv</tt></i> are adjusted accordingly so your own code will
50
never see those standard arguments.
52
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
53
This function will terminate your program if it was unable to initialize
54
the library for some reason. If you want your program to fall back to a
55
textual interface you want to call <a href="gtkglext-gtkglinit.html#gtk-gl-init-check">gtk_gl_init_check</a>() instead.
58
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>argc</tt></i>�:</span></td><td> Address of the <i class="parameter"><tt>argc</tt></i> parameter of your
59
<tt class="function">main()</tt> function. Changed if any arguments
61
</td></tr><tr><td><span class="term"><i class="parameter"><tt>argv</tt></i>�:</span></td><td> Address of the <i class="parameter"><tt>argv</tt></i> parameter of
62
<tt class="function">main()</tt>. Any parameters understood by
63
<a href="gtkglext-gtkglinit.html#gtk-gl-init">gtk_gl_init</a>() are stripped before return.
64
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gtk-gl-init-check"></a>gtk_gl_init_check ()</h3><pre class="programlisting">gboolean gtk_gl_init_check (int *argc,
65
char ***argv);</pre><p>
66
This function does the same work as <a href="gtkglext-gtkglinit.html#gtk-gl-init">gtk_gl_init</a>() with only
67
a single change: It does not terminate the program if the library can't be
68
initialized. Instead it returns <tt class="literal">FALSE</tt> on failure.
70
This way the application can fall back to some other means of communication
71
with the user - for example a curses or command line interface.</p><p>
73
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>argc</tt></i>�:</span></td><td> Address of the <i class="parameter"><tt>argc</tt></i> parameter of your
74
<tt class="function">main()</tt> function. Changed if any arguments
76
</td></tr><tr><td><span class="term"><i class="parameter"><tt>argv</tt></i>�:</span></td><td> Address of the <i class="parameter"><tt>argv</tt></i> parameter of
77
<tt class="function">main()</tt>. Any parameters understood by
78
<a href="gtkglext-gtkglinit.html#gtk-gl-init">gtk_gl_init</a>() are stripped before return.
79
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt class="literal">TRUE</tt> if the GUI has been successfully initialized,
80
<tt class="literal">FALSE</tt> otherwise.
81
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gtk-gl-parse-args"></a>gtk_gl_parse_args ()</h3><pre class="programlisting">gboolean gtk_gl_parse_args (int *argc,
82
char ***argv);</pre><p>
83
Parses command line arguments, and initializes global
84
attributes of GtkGLExt.
86
Any arguments used by GtkGLExt are removed from the array and
87
<i class="parameter"><tt>argc</tt></i> and <i class="parameter"><tt>argv</tt></i> are updated accordingly.
89
You shouldn't call this function explicitely if you are using
90
<a href="gtkglext-gtkglinit.html#gtk-gl-init">gtk_gl_init</a>(), or <a href="gtkglext-gtkglinit.html#gtk-gl-init-check">gtk_gl_init_check</a>().</p><p>
92
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>argc</tt></i>�:</span></td><td> the number of command line arguments.
93
</td></tr><tr><td><span class="term"><i class="parameter"><tt>argv</tt></i>�:</span></td><td> the array of command line arguments.
94
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt class="literal">TRUE</tt> if initialization succeeded, otherwise <tt class="literal">FALSE</tt>.
95
</td></tr></tbody></table></div></div></div></div><table class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle"><td align="left"><a accesskey="p" href="GtkGLExt-API.html"><b><<�Part�III.�GtkGLExt API Reference</b></a></td><td align="right"><a accesskey="n" href="gtkglext-gtkglwidget.html"><b>OpenGL-Capable Widget�>></b></a></td></tr></table></body></html>