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  * Conversion parameters:
26  * inFile  = gtkglext-gdkglquery.html
27  * outPack = glgdk
28  * outFile = GLQuery
29  * strct   = 
30  * realStrct=
31  * ctorStrct=
32  * clss    = GLQuery
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gdk_gl_query_
41  * 	- gdk_gl_
42  * omit structs:
43  * omit prefixes:
44  * omit code:
45  * omit signals:
46  * imports:
47  * 	- glib.Str
48  * 	- gdk.Display
49  * structWrap:
50  * 	- GdkDisplay* -> Display
51  * module aliases:
52  * local aliases:
53  * overrides:
54  */
55 
56 module glgdk.GLQuery;
57 
58 public  import gtkglc.glgdktypes;
59 
60 private import gtkglc.glgdk;
61 private import glib.ConstructionException;
62 private import gobject.ObjectG;
63 
64 
65 private import glib.Str;
66 private import gdk.Display;
67 
68 
69 
70 
71 /**
72  */
73 public class GLQuery
74 {
75 	
76 	/**
77 	 */
78 	
79 	/**
80 	 * Indicates whether the window system supports the OpenGL extension
81 	 * (GLX, WGL, etc.).
82 	 * Returns: TRUE if OpenGL is supported, FALSE otherwise.
83 	 */
84 	public static int extension()
85 	{
86 		// gboolean gdk_gl_query_extension (void);
87 		return gdk_gl_query_extension();
88 	}
89 	
90 	/**
91 	 * Indicates whether the window system supports the OpenGL extension
92 	 * (GLX, WGL, etc.).
93 	 * Params:
94 	 * display = the GdkDisplay where the query is sent to.
95 	 * Returns: TRUE if OpenGL is supported, FALSE otherwise.
96 	 */
97 	public static int extensionForDisplay(Display display)
98 	{
99 		// gboolean gdk_gl_query_extension_for_display (GdkDisplay *display);
100 		return gdk_gl_query_extension_for_display((display is null) ? null : display.getDisplayStruct());
101 	}
102 	
103 	/**
104 	 * Returns the version numbers of the OpenGL extension to the window system.
105 	 * In the X Window System, it returns the GLX version.
106 	 * In the Microsoft Windows, it returns the Windows version.
107 	 * Params:
108 	 * major = returns the major version number of the OpenGL extension.
109 	 * minor = returns the minor version number of the OpenGL extension.
110 	 * Returns: FALSE if it fails, TRUE otherwise.
111 	 */
112 	public static int versio(out int major, out int minor)
113 	{
114 		// gboolean gdk_gl_query_version (int *major,  int *minor);
115 		return gdk_gl_query_version(&major, &minor);
116 	}
117 	
118 	/**
119 	 * Returns the version numbers of the OpenGL extension to the window system.
120 	 * In the X Window System, it returns the GLX version.
121 	 * In the Microsoft Windows, it returns the Windows version.
122 	 * Params:
123 	 * display = the GdkDisplay where the query is sent to.
124 	 * major = returns the major version number of the OpenGL extension.
125 	 * minor = returns the minor version number of the OpenGL extension.
126 	 * Returns: FALSE if it fails, TRUE otherwise.
127 	 */
128 	public static int versionForDisplay(Display display, out int major, out int minor)
129 	{
130 		// gboolean gdk_gl_query_version_for_display (GdkDisplay *display,  int *major,  int *minor);
131 		return gdk_gl_query_version_for_display((display is null) ? null : display.getDisplayStruct(), &major, &minor);
132 	}
133 	
134 	/**
135 	 * Determines whether a given OpenGL extension is supported.
136 	 * There must be a valid current rendering context to call
137 	 * gdk_gl_query_gl_extension().
138 	 * gdk_gl_query_gl_extension() returns information about OpenGL extensions
139 	 * only. This means that window system dependent extensions (for example,
140 	 * GLX extensions) are not reported by gdk_gl_query_gl_extension().
141 	 * Params:
142 	 * extension = name of OpenGL extension.
143 	 * Returns: TRUE if the OpenGL extension is supported, FALSE if not supported.
144 	 */
145 	public static int glExtension(string extension)
146 	{
147 		// gboolean gdk_gl_query_gl_extension (const char *extension);
148 		return gdk_gl_query_gl_extension(Str.toStringz(extension));
149 	}
150 	
151 	/**
152 	 * Returns the address of the OpenGL, GLU, or GLX function.
153 	 * Params:
154 	 * procName = function name.
155 	 * Returns: the address of the function named by proc_name.
156 	 */
157 	public static GdkGLProc getProcAddress(string procName)
158 	{
159 		// GdkGLProc gdk_gl_get_proc_address (const char *proc_name);
160 		return gdk_gl_get_proc_address(Str.toStringz(procName));
161 	}
162 }