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 /** */ 33 public struct GLtInit 34 { 35 36 /** 37 * Call this function before using any other GtkGLExt functions in your 38 * applications. It will initialize everything needed to operate the library 39 * and parses some standard command line options. @argc and 40 * @argv are adjusted accordingly so your own code will 41 * never see those standard arguments. 42 * 43 * <note><para> 44 * This function will terminate your program if it was unable to initialize 45 * the library for some reason. If you want your program to fall back to a 46 * textual interface you want to call gtk_gl_init_check() instead. 47 * </para></note> 48 * 49 * Params: 50 * argc = Address of the <parameter>argc</parameter> parameter of your <function>main()</function> function. Changed if any arguments were handled. 51 * argv = Address of the <parameter>argv</parameter> parameter of <function>main()</function>. Any parameters understood by gtk_gl_init() are stripped before return. 52 */ 53 public static void init(ref string[] argv) 54 { 55 int argc = cast(int)argv.length; 56 char** outargv = Str.toStringzArray(argv); 57 58 gtk_gl_init(&argc, &outargv); 59 60 argv = Str.toStringArray(outargv, argc); 61 } 62 63 /** 64 * This function does the same work as gtk_gl_init() with only 65 * a single change: It does not terminate the program if the library can't be 66 * initialized. Instead it returns %FALSE on failure. 67 * 68 * This way the application can fall back to some other means of communication 69 * with the user - for example a curses or command line interface. 70 * 71 * Params: 72 * argc = Address of the <parameter>argc</parameter> parameter of your <function>main()</function> function. Changed if any arguments were handled. 73 * argv = Address of the <parameter>argv</parameter> parameter of <function>main()</function>. Any parameters understood by gtk_gl_init() are stripped before return. 74 * 75 * Return: %TRUE if the GUI has been successfully initialized, %FALSE otherwise. 76 */ 77 public static bool initCheck(ref string[] argv) 78 { 79 int argc = cast(int)argv.length; 80 char** outargv = Str.toStringzArray(argv); 81 82 auto p = gtk_gl_init_check(&argc, &outargv) != 0; 83 84 argv = Str.toStringArray(outargv, argc); 85 86 return p; 87 } 88 }