2 * This file is part of gtkD.
4 * gtkD 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 * gtkD 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 gtkD; 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 = gtkglext-gdkglconfig.html
47 * - GdkScreen* -> Screen
52 module glgdk
.GLConfig
;
58 import tango
.io
.Stdout
; // use the tango loging?
62 private import gtkglc
.glgdktypes
;
64 private import gtkglc
.glgdk
;
67 private import glib
.Str
;
68 private import gdk
.Screen
;
76 private import gobject
.ObjectG
;
77 public class GLConfig
: ObjectG
80 /** the main Gtk struct */
81 protected GdkGLConfig
* gdkGLConfig
;
84 public GdkGLConfig
* getGLConfigStruct()
90 /** the main Gtk struct as a void* */
91 protected void* getStruct()
93 return cast(void*)gdkGLConfig
;
97 * Sets our main struct and passes it to the parent class
99 public this (GdkGLConfig
* gdkGLConfig
)
103 if ( gdkGLConfig
is null )
108 Stdout("struct gdkGLConfig is null on constructor").newline
;
112 printf("struct gdkGLConfig is null on constructor");
119 assert(gdkGLConfig
!is null, "struct gdkGLConfig is null on constructor");
121 super(cast(GObject
*)gdkGLConfig
);
122 this.gdkGLConfig
= gdkGLConfig
;
126 * Creates a mew OpenGL frame buffer configuration that match the specified display mode,
127 * or the fallback mode.
128 * @param mode display mode bit mask.
130 this(GLConfigMode mode
, GLConfigMode fallback
)
133 gdkGLConfig
= cast(GdkGLConfig
*)gdk_gl_config_new_by_mode(mode
);
134 if ( gdkGLConfig
is null )
136 printf ("*** Cannot find the double-buffered visual.\n");
137 printf ("*** Trying single-buffered visual.\n");
138 gdkGLConfig
= cast(GdkGLConfig
*)gdk_gl_config_new_by_mode(fallback
);
140 if ( gdkGLConfig
is null )
142 printf ("*** No appropriate OpenGL-capable visual found.\n");
143 throw new Error("GL configure failed");
155 * Returns an OpenGL frame buffer configuration that match the specified
157 * attrib_list is a int array that contains the attribute/value pairs.
158 * Available attributes are:
159 * GDK_GL_USE_GL, GDK_GL_BUFFER_SIZE, GDK_GL_LEVEL, GDK_GL_RGBA,
160 * GDK_GL_DOUBLEBUFFER, GDK_GL_STEREO, GDK_GL_AUX_BUFFERS,
161 * GDK_GL_RED_SIZE, GDK_GL_GREEN_SIZE, GDK_GL_BLUE_SIZE, GDK_GL_ALPHA_SIZE,
162 * GDK_GL_DEPTH_SIZE, GDK_GL_STENCIL_SIZE, GDK_GL_ACCUM_RED_SIZE,
163 * GDK_GL_ACCUM_GREEN_SIZE, GDK_GL_ACCUM_BLUE_SIZE, GDK_GL_ACCUM_ALPHA_SIZE.
165 * a list of attribute/value pairs. The last attribute must
166 * be GDK_GL_ATTRIB_LIST_NONE.
168 * the new GdkGLConfig.
170 public this (int* attribList
)
172 // GdkGLConfig* gdk_gl_config_new (const int *attrib_list);
173 this(cast(GdkGLConfig
*)gdk_gl_config_new(attribList
) );
177 * Returns an OpenGL frame buffer configuration that match the specified
182 * a list of attribute/value pairs. The last attribute must
183 * be GDK_GL_ATTRIB_LIST_NONE.
185 * the new GdkGLConfig.
187 public this (Screen screen
, int* attribList
)
189 // GdkGLConfig* gdk_gl_config_new_for_screen (GdkScreen *screen, const int *attrib_list);
190 this(cast(GdkGLConfig
*)gdk_gl_config_new_for_screen((screen
is null) ?
null : screen
.getScreenStruct(), attribList
) );
194 * Returns an OpenGL frame buffer configuration that match the specified
197 * display mode bit mask.
199 * the new GdkGLConfig.
201 public this (GdkGLConfigMode mode
)
203 // GdkGLConfig* gdk_gl_config_new_by_mode (GdkGLConfigMode mode);
204 this(cast(GdkGLConfig
*)gdk_gl_config_new_by_mode(mode
) );
208 * Returns an OpenGL frame buffer configuration that match the specified
213 * display mode bit mask.
215 * the new GdkGLConfig.
217 public this (Screen screen
, GdkGLConfigMode mode
)
219 // GdkGLConfig* gdk_gl_config_new_by_mode_for_screen (GdkScreen *screen, GdkGLConfigMode mode);
220 this(cast(GdkGLConfig
*)gdk_gl_config_new_by_mode_for_screen((screen
is null) ?
null : screen
.getScreenStruct(), mode
) );
230 public Screen
getScreen()
232 // GdkScreen* gdk_gl_config_get_screen (GdkGLConfig *glconfig);
233 return new Screen( gdk_gl_config_get_screen(gdkGLConfig
) );
237 * Gets information about a OpenGL frame buffer configuration.
241 * the attribute to be returned.
243 * returns the requested value.
245 * TRUE if it succeeded, FALSE otherwise.
247 public int getAttrib(int attribute
, int* value
)
249 // gboolean gdk_gl_config_get_attrib (GdkGLConfig *glconfig, int attribute, int *value);
250 return gdk_gl_config_get_attrib(gdkGLConfig
, attribute
, value
);
254 * Gets the GdkColormap that is appropriate for the OpenGL frame buffer
259 * the appropriate GdkColormap.
261 public GdkColormap
* getColormap()
263 // GdkColormap* gdk_gl_config_get_colormap (GdkGLConfig *glconfig);
264 return gdk_gl_config_get_colormap(gdkGLConfig
);
268 * Gets the GdkVisual that is appropriate for the OpenGL frame buffer
273 * the appropriate GdkVisual.
275 public GdkVisual
* getVisual()
277 // GdkVisual* gdk_gl_config_get_visual (GdkGLConfig *glconfig);
278 return gdk_gl_config_get_visual(gdkGLConfig
);
282 * Gets the color depth of the OpenGL-capable visual.
286 * number of bits per pixel
288 public int getDepth()
290 // gint gdk_gl_config_get_depth (GdkGLConfig *glconfig);
291 return gdk_gl_config_get_depth(gdkGLConfig
);
295 * Gets the layer plane (level) of the frame buffer.
296 * Zero is the default frame buffer.
297 * Positive layer planes correspond to frame buffers that overlay the default
298 * buffer, and negative layer planes correspond to frame buffers that underlie
299 * the default frame buffer.
305 public int getLayerPlane()
307 // gint gdk_gl_config_get_layer_plane (GdkGLConfig *glconfig);
308 return gdk_gl_config_get_layer_plane(gdkGLConfig
);
312 * Gets the number of auxiliary color buffers.
316 * number of auxiliary color buffers.
318 public int getNAuxBuffers()
320 // gint gdk_gl_config_get_n_aux_buffers (GdkGLConfig *glconfig);
321 return gdk_gl_config_get_n_aux_buffers(gdkGLConfig
);
325 * Gets the number of multisample buffers.
329 * number of multisample buffers.
331 public int getNSampleBuffers()
333 // gint gdk_gl_config_get_n_sample_buffers (GdkGLConfig *glconfig);
334 return gdk_gl_config_get_n_sample_buffers(gdkGLConfig
);
338 * Returns whether the configured frame buffer is RGBA mode.
342 * TRUE if the configured frame buffer is RGBA mode, FALSE
347 // gboolean gdk_gl_config_is_rgba (GdkGLConfig *glconfig);
348 return gdk_gl_config_is_rgba(gdkGLConfig
);
352 * Returns whether the configuration supports the double-buffered visual.
356 * TRUE if the double-buffered visual is supported, FALSE
359 public int isDoubleBuffered()
361 // gboolean gdk_gl_config_is_double_buffered (GdkGLConfig *glconfig);
362 return gdk_gl_config_is_double_buffered(gdkGLConfig
);
366 * Returns whether the configuration supports the stereo visual.
370 * TRUE if the stereo visual is supported, FALSE otherwise.
372 public int isStereo()
374 // gboolean gdk_gl_config_is_stereo (GdkGLConfig *glconfig);
375 return gdk_gl_config_is_stereo(gdkGLConfig
);
379 * Returns whether the configured color buffer has alpha bits.
383 * TRUE if the color buffer has alpha bits, FALSE otherwise.
385 public int hasAlpha()
387 // gboolean gdk_gl_config_has_alpha (GdkGLConfig *glconfig);
388 return gdk_gl_config_has_alpha(gdkGLConfig
);
392 * Returns whether the configured frame buffer has depth buffer.
396 * TRUE if the frame buffer has depth buffer, FALSE otherwise.
398 public int hasDepthBuffer()
400 // gboolean gdk_gl_config_has_depth_buffer (GdkGLConfig *glconfig);
401 return gdk_gl_config_has_depth_buffer(gdkGLConfig
);
405 * Returns whether the configured frame buffer has stencil buffer.
409 * TRUE if the frame buffer has stencil buffer, FALSE otherwise.
411 public int hasStencilBuffer()
413 // gboolean gdk_gl_config_has_stencil_buffer (GdkGLConfig *glconfig);
414 return gdk_gl_config_has_stencil_buffer(gdkGLConfig
);
418 * Returns whether the configured frame buffer has accumulation buffer.
422 * TRUE if the frame buffer has accumulation buffer, FALSE
425 * Rendering Context>>
427 public int hasAccumBuffer()
429 // gboolean gdk_gl_config_has_accum_buffer (GdkGLConfig *glconfig);
430 return gdk_gl_config_has_accum_buffer(gdkGLConfig
);