2 * This file is part of duit.
4 * duit 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 * duit 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 duit; 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 = /usr/share/doc/libgtkglext1-doc/html/gtkglext/gtkglext-gdkglconfig.html
47 * - GdkScreen* -> Screen
51 module glgdk
.GLConfig
;
53 private import glgdk
.glgdktypes
;
55 private import lib
.glgdk
;
57 private import glib
.Str
;
58 private import gdk
.Screen
;
63 private import gobject
.ObjectG
;
64 public class GLConfig
: ObjectG
67 /** the main Gtk struct */
68 protected GdkGLConfig
* gdkGLConfig
;
71 public GdkGLConfig
* getGLConfigStruct()
77 /** the main Gtk struct as a void* */
78 protected void* getStruct()
80 return cast(void*)gdkGLConfig
;
84 * Sets our main struct and passes it to the parent class
86 public this (GdkGLConfig
* gdkGLConfig
)
88 super(cast(GObject
*)gdkGLConfig
);
89 this.gdkGLConfig
= gdkGLConfig
;
93 * Creates a mew OpenGL frame buffer configuration that match the specified display mode,
94 * or the fallback mode.
95 * @param mode display mode bit mask.
97 this(GLConfigMode mode
, GLConfigMode fallback
)
100 gdkGLConfig
= cast(GdkGLConfig
*)gdk_gl_config_new_by_mode(mode
);
101 if ( gdkGLConfig
is null )
103 printf ("*** Cannot find the double-buffered visual.\n");
104 printf ("*** Trying single-buffered visual.\n");
105 gdkGLConfig
= cast(GdkGLConfig
*)gdk_gl_config_new_by_mode(fallback
);
107 if ( gdkGLConfig
is null )
109 printf ("*** No appropriate OpenGL-capable visual found.\n");
110 throw new Error("GL configure failed");
122 * Returns an OpenGL frame buffer configuration that match the specified
124 * attrib_list is a int array that contains the attribute/value pairs.
125 * Available attributes are:
126 * GDK_GL_USE_GL, GDK_GL_BUFFER_SIZE, GDK_GL_LEVEL, GDK_GL_RGBA,
127 * GDK_GL_DOUBLEBUFFER, GDK_GL_STEREO, GDK_GL_AUX_BUFFERS,
128 * GDK_GL_RED_SIZE, GDK_GL_GREEN_SIZE, GDK_GL_BLUE_SIZE, GDK_GL_ALPHA_SIZE,
129 * GDK_GL_DEPTH_SIZE, GDK_GL_STENCIL_SIZE, GDK_GL_ACCUM_RED_SIZE,
130 * GDK_GL_ACCUM_GREEN_SIZE, GDK_GL_ACCUM_BLUE_SIZE, GDK_GL_ACCUM_ALPHA_SIZE.
131 * attrib_list : a list of attribute/value pairs. The last attribute must
132 * be GDK_GL_ATTRIB_LIST_NONE.
133 * Returns : the new GdkGLConfig.
135 public this (int* attribList
)
137 // GdkGLConfig* gdk_gl_config_new (const int *attrib_list);
138 this(cast(GdkGLConfig
*)gdk_gl_config_new(attribList
) );
142 * Returns an OpenGL frame buffer configuration that match the specified
144 * screen : target screen.
145 * attrib_list : a list of attribute/value pairs. The last attribute must
146 * be GDK_GL_ATTRIB_LIST_NONE.
147 * Returns : the new GdkGLConfig.
149 public this (Screen screen
, int* attribList
)
151 // GdkGLConfig* gdk_gl_config_new_for_screen (GdkScreen *screen, const int *attrib_list);
152 this(cast(GdkGLConfig
*)gdk_gl_config_new_for_screen((screen
is null) ?
null : screen
.getScreenStruct(), attribList
) );
156 * Returns an OpenGL frame buffer configuration that match the specified
158 * mode : display mode bit mask.
159 * Returns : the new GdkGLConfig.
161 public this (GdkGLConfigMode mode
)
163 // GdkGLConfig* gdk_gl_config_new_by_mode (GdkGLConfigMode mode);
164 this(cast(GdkGLConfig
*)gdk_gl_config_new_by_mode(mode
) );
168 * Returns an OpenGL frame buffer configuration that match the specified
170 * screen : target screen.
171 * mode : display mode bit mask.
172 * Returns : the new GdkGLConfig.
174 public this (Screen screen
, GdkGLConfigMode mode
)
176 // GdkGLConfig* gdk_gl_config_new_by_mode_for_screen (GdkScreen *screen, GdkGLConfigMode mode);
177 this(cast(GdkGLConfig
*)gdk_gl_config_new_by_mode_for_screen((screen
is null) ?
null : screen
.getScreenStruct(), mode
) );
182 * glconfig : a GdkGLConfig.
183 * Returns : the GdkScreen.
185 public Screen
getScreen()
187 // GdkScreen* gdk_gl_config_get_screen (GdkGLConfig *glconfig);
188 return new Screen( gdk_gl_config_get_screen(gdkGLConfig
) );
192 * Gets information about a OpenGL frame buffer configuration.
193 * glconfig : a GdkGLConfig.
194 * attribute : the attribute to be returned.
195 * value : returns the requested value.
196 * Returns : TRUE if it succeeded, FALSE otherwise.
198 public int getAttrib(int attribute
, int* value
)
200 // gboolean gdk_gl_config_get_attrib (GdkGLConfig *glconfig, int attribute, int *value);
201 return gdk_gl_config_get_attrib(gdkGLConfig
, attribute
, value
);
205 * Gets the GdkColormap that is appropriate for the OpenGL frame buffer
207 * glconfig : a GdkGLConfig.
208 * Returns : the appropriate GdkColormap.
210 public GdkColormap
* getColormap()
212 // GdkColormap* gdk_gl_config_get_colormap (GdkGLConfig *glconfig);
213 return gdk_gl_config_get_colormap(gdkGLConfig
);
217 * Gets the GdkVisual that is appropriate for the OpenGL frame buffer
219 * glconfig : a GdkGLConfig.
220 * Returns : the appropriate GdkVisual.
222 public GdkVisual
* getVisual()
224 // GdkVisual* gdk_gl_config_get_visual (GdkGLConfig *glconfig);
225 return gdk_gl_config_get_visual(gdkGLConfig
);
229 * Gets the color depth of the OpenGL-capable visual.
230 * glconfig : a GdkGLConfig.
231 * Returns : number of bits per pixel
233 public int getDepth()
235 // gint gdk_gl_config_get_depth (GdkGLConfig *glconfig);
236 return gdk_gl_config_get_depth(gdkGLConfig
);
240 * Gets the layer plane (level) of the frame buffer.
241 * Zero is the default frame buffer.
242 * Positive layer planes correspond to frame buffers that overlay the default
243 * buffer, and negative layer planes correspond to frame buffers that underlie
244 * the default frame buffer.
245 * glconfig : a GdkGLConfig.
246 * Returns : layer plane.
248 public int getLayerPlane()
250 // gint gdk_gl_config_get_layer_plane (GdkGLConfig *glconfig);
251 return gdk_gl_config_get_layer_plane(gdkGLConfig
);
255 * Gets the number of auxiliary color buffers.
256 * glconfig : a GdkGLConfig.
257 * Returns : number of auxiliary color buffers.
259 public int getNAuxBuffers()
261 // gint gdk_gl_config_get_n_aux_buffers (GdkGLConfig *glconfig);
262 return gdk_gl_config_get_n_aux_buffers(gdkGLConfig
);
266 * Gets the number of multisample buffers.
267 * glconfig : a GdkGLConfig.
268 * Returns : number of multisample buffers.
270 public int getNSampleBuffers()
272 // gint gdk_gl_config_get_n_sample_buffers (GdkGLConfig *glconfig);
273 return gdk_gl_config_get_n_sample_buffers(gdkGLConfig
);
277 * Returns whether the configured frame buffer is RGBA mode.
278 * glconfig : a GdkGLConfig.
279 * Returns : TRUE if the configured frame buffer is RGBA mode, FALSE
284 // gboolean gdk_gl_config_is_rgba (GdkGLConfig *glconfig);
285 return gdk_gl_config_is_rgba(gdkGLConfig
);
289 * Returns whether the configuration supports the double-buffered visual.
290 * glconfig : a GdkGLConfig.
291 * Returns : TRUE if the double-buffered visual is supported, FALSE
294 public int isDoubleBuffered()
296 // gboolean gdk_gl_config_is_double_buffered (GdkGLConfig *glconfig);
297 return gdk_gl_config_is_double_buffered(gdkGLConfig
);
301 * Returns whether the configuration supports the stereo visual.
302 * glconfig : a GdkGLConfig.
303 * Returns : TRUE if the stereo visual is supported, FALSE otherwise.
305 public int isStereo()
307 // gboolean gdk_gl_config_is_stereo (GdkGLConfig *glconfig);
308 return gdk_gl_config_is_stereo(gdkGLConfig
);
312 * Returns whether the configured color buffer has alpha bits.
313 * glconfig : a GdkGLConfig.
314 * Returns : TRUE if the color buffer has alpha bits, FALSE otherwise.
316 public int hasAlpha()
318 // gboolean gdk_gl_config_has_alpha (GdkGLConfig *glconfig);
319 return gdk_gl_config_has_alpha(gdkGLConfig
);
323 * Returns whether the configured frame buffer has depth buffer.
324 * glconfig : a GdkGLConfig.
325 * Returns : TRUE if the frame buffer has depth buffer, FALSE otherwise.
327 public int hasDepthBuffer()
329 // gboolean gdk_gl_config_has_depth_buffer (GdkGLConfig *glconfig);
330 return gdk_gl_config_has_depth_buffer(gdkGLConfig
);
334 * Returns whether the configured frame buffer has stencil buffer.
335 * glconfig : a GdkGLConfig.
336 * Returns : TRUE if the frame buffer has stencil buffer, FALSE otherwise.
338 public int hasStencilBuffer()
340 // gboolean gdk_gl_config_has_stencil_buffer (GdkGLConfig *glconfig);
341 return gdk_gl_config_has_stencil_buffer(gdkGLConfig
);
345 * Returns whether the configured frame buffer has accumulation buffer.
346 * glconfig : a GdkGLConfig.
347 * Returns : TRUE if the frame buffer has accumulation buffer, FALSE
349 * << QueryRendering Context >>
351 public int hasAccumBuffer()
353 // gboolean gdk_gl_config_has_accum_buffer (GdkGLConfig *glconfig);
354 return gdk_gl_config_has_accum_buffer(gdkGLConfig
);