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 glgdk.GLQuery;
26 
27 private import gdk.Display;
28 private import glib.Str;
29 private import gtkglc.glgdk;
30 public  import gtkglc.glgdktypes;
31 
32 
33 /** */
34 public struct GLQuery
35 {
36 
37 	/**
38 	 * Returns the version numbers of the OpenGL extension to the window system.
39 	 *
40 	 * In the X Window System, it returns the GLX version.
41 	 *
42 	 * In the Microsoft Windows, it returns the Windows version.
43 	 *
44 	 * Params:
45 	 *     major = returns the major version number of the OpenGL extension.
46 	 *     minor = returns the minor version number of the OpenGL extension.
47 	 *
48 	 * Return: FALSE if it fails, TRUE otherwise.
49 	 */
50 	public static bool versio(out int major, out int minor)
51 	{
52 		return gdk_gl_query_version(&major, &minor) != 0;
53 	}
54 
55 	/**
56 	 * Returns the version numbers of the OpenGL extension to the window system.
57 	 *
58 	 * In the X Window System, it returns the GLX version.
59 	 *
60 	 * In the Microsoft Windows, it returns the Windows version.
61 	 *
62 	 * Params:
63 	 *     display = the #GdkDisplay where the query is sent to.
64 	 *     major = returns the major version number of the OpenGL extension.
65 	 *     minor = returns the minor version number of the OpenGL extension.
66 	 *
67 	 * Return: FALSE if it fails, TRUE otherwise.
68 	 */
69 	public static bool versionForDisplay(Display display, out int major, out int minor)
70 	{
71 		return gdk_gl_query_version_for_display((display is null) ? null : display.getDisplayStruct(), &major, &minor) != 0;
72 	}
73 
74 	/**
75 	 * Returns the address of the OpenGL, GLU, or GLX function.
76 	 *
77 	 * Params:
78 	 *     procName = function name.
79 	 *
80 	 * Return: the address of the function named by @proc_name.
81 	 */
82 	public static GdkGLProc getProcAddress(string procName)
83 	{
84 		return gdk_gl_get_proc_address(Str.toStringz(procName));
85 	}
86 
87 	/**
88 	 * Indicates whether the window system supports the OpenGL extension
89 	 * (GLX, WGL, etc.).
90 	 *
91 	 * Return: TRUE if OpenGL is supported, FALSE otherwise.
92 	 */
93 	public static bool extension()
94 	{
95 		return gdk_gl_query_extension() != 0;
96 	}
97 
98 	/**
99 	 * Indicates whether the window system supports the OpenGL extension
100 	 * (GLX, WGL, etc.).
101 	 *
102 	 * Params:
103 	 *     display = the #GdkDisplay where the query is sent to.
104 	 *
105 	 * Return: TRUE if OpenGL is supported, FALSE otherwise.
106 	 */
107 	public static bool extensionForDisplay(Display display)
108 	{
109 		return gdk_gl_query_extension_for_display((display is null) ? null : display.getDisplayStruct()) != 0;
110 	}
111 
112 	/**
113 	 * Determines whether a given OpenGL extension is supported.
114 	 *
115 	 * There must be a valid current rendering context to call
116 	 * gdk_gl_query_gl_extension().
117 	 *
118 	 * gdk_gl_query_gl_extension() returns information about OpenGL extensions
119 	 * only. This means that window system dependent extensions (for example,
120 	 * GLX extensions) are not reported by gdk_gl_query_gl_extension().
121 	 *
122 	 * Params:
123 	 *     extension = name of OpenGL extension.
124 	 *
125 	 * Return: TRUE if the OpenGL extension is supported, FALSE if not supported.
126 	 */
127 	public static bool glExtension(string extension)
128 	{
129 		return gdk_gl_query_gl_extension(Str.toStringz(extension)) != 0;
130 	}
131 }