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 private import glib.Str;
65 private import gdk.Display;
66 
67 
68 
69 /**
70  */
71 public class GLQuery
72 {
73 	
74 	/**
75 	 */
76 	
77 	/**
78 	 * Indicates whether the window system supports the OpenGL extension
79 	 * (GLX, WGL, etc.).
80 	 * Returns: TRUE if OpenGL is supported, FALSE otherwise.
81 	 */
82 	public static int extension()
83 	{
84 		// gboolean gdk_gl_query_extension (void);
85 		return gdk_gl_query_extension();
86 	}
87 	
88 	/**
89 	 * Indicates whether the window system supports the OpenGL extension
90 	 * (GLX, WGL, etc.).
91 	 * Params:
92 	 * display = the GdkDisplay where the query is sent to.
93 	 * Returns: TRUE if OpenGL is supported, FALSE otherwise.
94 	 */
95 	public static int extensionForDisplay(Display display)
96 	{
97 		// gboolean gdk_gl_query_extension_for_display (GdkDisplay *display);
98 		return gdk_gl_query_extension_for_display((display is null) ? null : display.getDisplayStruct());
99 	}
100 	
101 	/**
102 	 * Returns the version numbers of the OpenGL extension to the window system.
103 	 * In the X Window System, it returns the GLX version.
104 	 * In the Microsoft Windows, it returns the Windows version.
105 	 * Params:
106 	 * major = returns the major version number of the OpenGL extension.
107 	 * minor = returns the minor version number of the OpenGL extension.
108 	 * Returns: FALSE if it fails, TRUE otherwise.
109 	 */
110 	public static int versio(out int major, out int minor)
111 	{
112 		// gboolean gdk_gl_query_version (int *major,  int *minor);
113 		return gdk_gl_query_version(&major, &minor);
114 	}
115 	
116 	/**
117 	 * Returns the version numbers of the OpenGL extension to the window system.
118 	 * In the X Window System, it returns the GLX version.
119 	 * In the Microsoft Windows, it returns the Windows version.
120 	 * Params:
121 	 * display = the GdkDisplay where the query is sent to.
122 	 * major = returns the major version number of the OpenGL extension.
123 	 * minor = returns the minor version number of the OpenGL extension.
124 	 * Returns: FALSE if it fails, TRUE otherwise.
125 	 */
126 	public static int versionForDisplay(Display display, out int major, out int minor)
127 	{
128 		// gboolean gdk_gl_query_version_for_display (GdkDisplay *display,  int *major,  int *minor);
129 		return gdk_gl_query_version_for_display((display is null) ? null : display.getDisplayStruct(), &major, &minor);
130 	}
131 	
132 	/**
133 	 * Determines whether a given OpenGL extension is supported.
134 	 * There must be a valid current rendering context to call
135 	 * gdk_gl_query_gl_extension().
136 	 * gdk_gl_query_gl_extension() returns information about OpenGL extensions
137 	 * only. This means that window system dependent extensions (for example,
138 	 * GLX extensions) are not reported by gdk_gl_query_gl_extension().
139 	 * Params:
140 	 * extension = name of OpenGL extension.
141 	 * Returns: TRUE if the OpenGL extension is supported, FALSE if not supported.
142 	 */
143 	public static int glExtension(string extension)
144 	{
145 		// gboolean gdk_gl_query_gl_extension (const char *extension);
146 		return gdk_gl_query_gl_extension(Str.toStringz(extension));
147 	}
148 	
149 	/**
150 	 * Returns the address of the OpenGL, GLU, or GLX function.
151 	 * Params:
152 	 * procName = function name.
153 	 * Returns: the address of the function named by proc_name.
154 	 */
155 	public static GdkGLProc getProcAddress(string procName)
156 	{
157 		// GdkGLProc gdk_gl_get_proc_address (const char *proc_name);
158 		return gdk_gl_get_proc_address(Str.toStringz(procName));
159 	}
160 }