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