<refentry id="gtkglext-gtkglinit">
<refmeta>
<refentrytitle>Initialization</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTKGLEXT Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>Initialization</refname><refpurpose>Library initialization functions</refpurpose>
</refnamediv>

<refsynopsisdiv><title>Synopsis</title>

<synopsis>

#include &lt;gtk/gtkgl.h&gt;


<link linkend="void">void</link>        <link linkend="gtk-gl-init">gtk_gl_init</link>                     (<link linkend="int">int</link> *argc,
                                             <link linkend="char">char</link> ***argv);
<link linkend="gboolean">gboolean</link>    <link linkend="gtk-gl-init-check">gtk_gl_init_check</link>               (<link linkend="int">int</link> *argc,
                                             <link linkend="char">char</link> ***argv);
<link linkend="gboolean">gboolean</link>    <link linkend="gtk-gl-parse-args">gtk_gl_parse_args</link>               (<link linkend="int">int</link> *argc,
                                             <link linkend="char">char</link> ***argv);
</synopsis>
</refsynopsisdiv>









<refsect1>
<title>Description</title>
<para>

</para>
</refsect1>

<refsect1>
<title>Details</title>
<refsect2>
<title><anchor id="gtk-gl-init"/>gtk_gl_init ()</title>
<indexterm><primary>gtk_gl_init</primary></indexterm><programlisting><link linkend="void">void</link>        gtk_gl_init                     (<link linkend="int">int</link> *argc,
                                             <link linkend="char">char</link> ***argv);</programlisting>
<para>
Call this function before using any other GtkGLExt functions in your 
applications.  It will initialize everything needed to operate the library
and parses some standard command line options. <parameter>argc</parameter> and 
<parameter>argv</parameter> are adjusted accordingly so your own code will 
never see those standard arguments.
</para>
<para>
<note><para>
This function will terminate your program if it was unable to initialize 
the library for some reason. If you want your program to fall back to a 
textual interface you want to call <link linkend="gtk-gl-init-check"><function>gtk_gl_init_check()</function></link> instead.
</para></note></para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>argc</parameter>&nbsp;:</term>
<listitem><simpara> Address of the <parameter>argc</parameter> parameter of your 
       <function><link linkend="main"><function>main()</function></link></function> function. Changed if any arguments
       were handled.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>argv</parameter>&nbsp;:</term>
<listitem><simpara> Address of the <parameter>argv</parameter> parameter of 
       <function><link linkend="main"><function>main()</function></link></function>. Any parameters understood by
       <link linkend="gtk-gl-init"><function>gtk_gl_init()</function></link> are stripped before return.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gtk-gl-init-check"/>gtk_gl_init_check ()</title>
<indexterm><primary>gtk_gl_init_check</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    gtk_gl_init_check               (<link linkend="int">int</link> *argc,
                                             <link linkend="char">char</link> ***argv);</programlisting>
<para>
This function does the same work as <link linkend="gtk-gl-init"><function>gtk_gl_init()</function></link> with only 
a single change: It does not terminate the program if the library can't be 
initialized. Instead it returns <literal>FALSE</literal> on failure.
</para>
<para>
This way the application can fall back to some other means of communication 
with the user - for example a curses or command line interface.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>argc</parameter>&nbsp;:</term>
<listitem><simpara> Address of the <parameter>argc</parameter> parameter of your 
       <function><link linkend="main"><function>main()</function></link></function> function. Changed if any arguments
       were handled.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>argv</parameter>&nbsp;:</term>
<listitem><simpara> Address of the <parameter>argv</parameter> parameter of 
       <function><link linkend="main"><function>main()</function></link></function>. Any parameters understood by
       <link linkend="gtk-gl-init"><function>gtk_gl_init()</function></link> are stripped before return.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <literal>TRUE</literal> if the GUI has been successfully initialized, 
              <literal>FALSE</literal> otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gtk-gl-parse-args"/>gtk_gl_parse_args ()</title>
<indexterm><primary>gtk_gl_parse_args</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    gtk_gl_parse_args               (<link linkend="int">int</link> *argc,
                                             <link linkend="char">char</link> ***argv);</programlisting>
<para>
Parses command line arguments, and initializes global
attributes of GtkGLExt.
</para>
<para>
Any arguments used by GtkGLExt are removed from the array and
<parameter>argc</parameter> and <parameter>argv</parameter> are updated accordingly.
</para>
<para>
You shouldn't call this function explicitely if you are using
<link linkend="gtk-gl-init"><function>gtk_gl_init()</function></link>, or <link linkend="gtk-gl-init-check"><function>gtk_gl_init_check()</function></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>argc</parameter>&nbsp;:</term>
<listitem><simpara> the number of command line arguments.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>argv</parameter>&nbsp;:</term>
<listitem><simpara> the array of command line arguments.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <literal>TRUE</literal> if initialization succeeded, otherwise <literal>FALSE</literal>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
