alternative to assert
[gtkD.git] / gtkD / srcgl / glgdk / GLQuery.d
blob9fed18f44ec236244f0e8e92ddd12c753441e2df
1 /*
2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = gtkglext-gdkglquery.html
26 * outPack = glgdk
27 * outFile = GLQuery
28 * strct =
29 * realStrct=
30 * ctorStrct=
31 * clss = GLQuery
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gdk_gl_query_
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * imports:
44 * - glib.Str
45 * - gdk.Display
46 * structWrap:
47 * - GdkDisplay* -> Display
48 * module aliases:
49 * local aliases:
52 module glgdk.GLQuery;
54 version(noAssert)
56 version(Tango)
58 import tango.io.Stdout; // use the tango loging?
62 private import gtkglc.glgdktypes;
64 private import gtkglc.glgdk;
67 private import glib.Str;
68 private import gdk.Display;
73 /**
74 * Description
76 public class GLQuery
79 /**
83 /**
84 * Indicates whether the window system supports the OpenGL extension
85 * (GLX, WGL, etc.).
86 * Returns:
87 * TRUE if OpenGL is supported, FALSE otherwise.
89 public static int extension()
91 // gboolean gdk_gl_query_extension (void);
92 return gdk_gl_query_extension();
95 /**
96 * Indicates whether the window system supports the OpenGL extension
97 * (GLX, WGL, etc.).
98 * display:
99 * the GdkDisplay where the query is sent to.
100 * Returns:
101 * TRUE if OpenGL is supported, FALSE otherwise.
103 public static int extensionForDisplay(Display display)
105 // gboolean gdk_gl_query_extension_for_display (GdkDisplay *display);
106 return gdk_gl_query_extension_for_display((display is null) ? null : display.getDisplayStruct());
110 * Returns the version numbers of the OpenGL extension to the window system.
111 * In the X Window System, it returns the GLX version.
112 * In the Microsoft Windows, it returns the Windows version.
113 * major:
114 * returns the major version number of the OpenGL extension.
115 * minor:
116 * returns the minor version number of the OpenGL extension.
117 * Returns:
118 * FALSE if it fails, TRUE otherwise.
120 public static int versio(int* major, int* minor)
122 // gboolean gdk_gl_query_version (int *major, int *minor);
123 return gdk_gl_query_version(major, minor);
127 * Returns the version numbers of the OpenGL extension to the window system.
128 * In the X Window System, it returns the GLX version.
129 * In the Microsoft Windows, it returns the Windows version.
130 * display:
131 * the GdkDisplay where the query is sent to.
132 * major:
133 * returns the major version number of the OpenGL extension.
134 * minor:
135 * returns the minor version number of the OpenGL extension.
136 * Returns:
137 * FALSE if it fails, TRUE otherwise.
139 public static int versionForDisplay(Display display, int* major, int* minor)
141 // gboolean gdk_gl_query_version_for_display (GdkDisplay *display, int *major, int *minor);
142 return gdk_gl_query_version_for_display((display is null) ? null : display.getDisplayStruct(), major, minor);
146 * Determines whether a given OpenGL extension is supported.
147 * There must be a valid current rendering context to call
148 * gdk_gl_query_gl_extension().
149 * gdk_gl_query_gl_extension() returns information about OpenGL extensions
150 * only. This means that window system dependent extensions (for example,
151 * GLX extensions) are not reported by gdk_gl_query_gl_extension().
152 * extension:
153 * name of OpenGL extension.
154 * Returns:
155 * TRUE if the OpenGL extension is supported, FALSE if not
156 * supported.
158 public static int glExtension(char[] extension)
160 // gboolean gdk_gl_query_gl_extension (const char *extension);
161 return gdk_gl_query_gl_extension(Str.toStringz(extension));
165 * Returns the address of the OpenGL, GLU, or GLX function.
166 * proc_name:
167 * function name.
168 * Returns:
169 * the address of the function named by proc_name.
170 * <<Initialization
171 * Frame Buffer Configuration>>
173 public static GdkGLProc gdkGLGetProcAddress(char[] procName)
175 // GdkGLProc gdk_gl_get_proc_address (const char *proc_name);
176 return gdk_gl_get_proc_address(Str.toStringz(procName));