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-gdkgldrawable.html
27 * outFile = GLDrawable
28 * strct = GdkGLDrawable
46 * - GdkGLContext* -> GLContext
51 module glgdk
.GLDrawable
;
57 import tango
.io
.Stdout
; // use the tango loging?
61 private import gtkglc
.glgdktypes
;
63 private import gtkglc
.glgdk
;
66 private import glgdk
.GLContext
;
74 public class GLDrawable
77 /** the main Gtk struct */
78 protected GdkGLDrawable
* gdkGLDrawable
;
81 public GdkGLDrawable
* getGLDrawableStruct()
87 /** the main Gtk struct as a void* */
88 protected void* getStruct()
90 return cast(void*)gdkGLDrawable
;
94 * Sets our main struct and passes it to the parent class
96 public this (GdkGLDrawable
* gdkGLDrawable
)
100 if ( gdkGLDrawable
is null )
105 Stdout("struct gdkGLDrawable is null on constructor").newline
;
109 printf("struct gdkGLDrawable is null on constructor");
116 assert(gdkGLDrawable
!is null, "struct gdkGLDrawable is null on constructor");
118 this.gdkGLDrawable
= gdkGLDrawable
;
126 * Attach an OpenGL rendering context to a gldrawable.
132 * TRUE if it is successful, FALSE otherwise.
134 public int makeCurrent(GLContext glcontext
)
136 // gboolean gdk_gl_drawable_make_current (GdkGLDrawable *gldrawable, GdkGLContext *glcontext);
137 return gdk_gl_drawable_make_current(gdkGLDrawable
, (glcontext
is null) ?
null : glcontext
.getGLContextStruct());
141 * Returns whether the gldrawable supports the double-buffered visual.
145 * TRUE if the double-buffered visual is supported,
148 public int isDoubleBuffered()
150 // gboolean gdk_gl_drawable_is_double_buffered (GdkGLDrawable *gldrawable);
151 return gdk_gl_drawable_is_double_buffered(gdkGLDrawable
);
155 * Exchange front and back buffers.
159 public void swapBuffers()
161 // void gdk_gl_drawable_swap_buffers (GdkGLDrawable *gldrawable);
162 gdk_gl_drawable_swap_buffers(gdkGLDrawable
);
166 * Complete OpenGL execution prior to subsequent GDK drawing calls.
172 // void gdk_gl_drawable_wait_gl (GdkGLDrawable *gldrawable);
173 gdk_gl_drawable_wait_gl(gdkGLDrawable
);
177 * Complete GDK drawing execution prior to subsequent OpenGL calls.
181 public void waitGdk()
183 // void gdk_gl_drawable_wait_gdk (GdkGLDrawable *gldrawable);
184 gdk_gl_drawable_wait_gdk(gdkGLDrawable
);
188 * Delimits the begining of the OpenGL execution.
194 * TRUE if it is successful, FALSE otherwise.
196 public int glBegin(GLContext glcontext
)
198 // gboolean gdk_gl_drawable_gl_begin (GdkGLDrawable *gldrawable, GdkGLContext *glcontext);
199 return gdk_gl_drawable_gl_begin(gdkGLDrawable
, (glcontext
is null) ?
null : glcontext
.getGLContextStruct());
203 * Delimits the end of the OpenGL execution.
209 // void gdk_gl_drawable_gl_end (GdkGLDrawable *gldrawable);
210 gdk_gl_drawable_gl_end(gdkGLDrawable
);
214 * Gets GdkGLConfig with which the gldrawable is configured.
220 public GdkGLConfig
* getGLConfig()
222 // GdkGLConfig* gdk_gl_drawable_get_gl_config (GdkGLDrawable *gldrawable);
223 return gdk_gl_drawable_get_gl_config(gdkGLDrawable
);
227 * Fills *width and *height with the size of GL drawable.
228 * width or height can be NULL if you only want the other one.
232 * location to store drawable's width, or NULL.
234 * location to store drawable's height, or NULL.
236 public void getSize(int* width
, int* height
)
238 // void gdk_gl_drawable_get_size (GdkGLDrawable *gldrawable, gint *width, gint *height);
239 gdk_gl_drawable_get_size(gdkGLDrawable
, width
, height
);
243 * Returns the current GdkGLDrawable.
245 * the current GdkGLDrawable or NULL if there is no current drawable.
246 * <<Rendering Context
249 public static GdkGLDrawable
* getCurrent()
251 // GdkGLDrawable* gdk_gl_drawable_get_current (void);
252 return gdk_gl_drawable_get_current();