1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module glgtk.GLtInit;
26 
27 private import glib.Str;
28 private import gtkglc.glgtk;
29 public  import gtkglc.glgtktypes;
30 
31 
32 public struct GLtInit
33 {
34 	/**
35 	 */
36 
37 	/**
38 	 * Call this function before using any other GtkGLExt functions in your
39 	 * applications.  It will initialize everything needed to operate the library
40 	 * and parses some standard command line options. @argc and
41 	 * @argv are adjusted accordingly so your own code will
42 	 * never see those standard arguments.
43 	 *
44 	 * <note><para>
45 	 * This function will terminate your program if it was unable to initialize
46 	 * the library for some reason. If you want your program to fall back to a
47 	 * textual interface you want to call gtk_gl_init_check() instead.
48 	 * </para></note>
49 	 *
50 	 * Params:
51 	 *     argc = Address of the <parameter>argc</parameter> parameter of your <function>main()</function> function. Changed if any arguments were handled.
52 	 *     argv = Address of the <parameter>argv</parameter> parameter of <function>main()</function>. Any parameters understood by gtk_gl_init() are stripped before return.
53 	 */
54 	public static void init(ref string[] argv)
55 	{
56 		int argc = cast(int)argv.length;
57 		char** outargv = Str.toStringzArray(argv);
58 		
59 		gtk_gl_init(&argc, &outargv);
60 		
61 		argv = Str.toStringArray(outargv, argc);
62 	}
63 
64 	/**
65 	 * This function does the same work as gtk_gl_init() with only
66 	 * a single change: It does not terminate the program if the library can't be
67 	 * initialized. Instead it returns %FALSE on failure.
68 	 *
69 	 * This way the application can fall back to some other means of communication
70 	 * with the user - for example a curses or command line interface.
71 	 *
72 	 * %FALSE otherwise.
73 	 *
74 	 * Params:
75 	 *     argc = Address of the <parameter>argc</parameter> parameter of your <function>main()</function> function. Changed if any arguments were handled.
76 	 *     argv = Address of the <parameter>argv</parameter> parameter of <function>main()</function>. Any parameters understood by gtk_gl_init() are stripped before return.
77 	 *
78 	 * Return: %TRUE if the GUI has been successfully initialized,
79 	 */
80 	public static bool initCheck(ref string[] argv)
81 	{
82 		int argc = cast(int)argv.length;
83 		char** outargv = Str.toStringzArray(argv);
84 		
85 		auto p = gtk_gl_init_check(&argc, &outargv) != 0;
86 		
87 		argv = Str.toStringArray(outargv, argc);
88 		
89 		return p;
90 	}
91 }