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-gdkgldrawable.html
27 * outFile = GLDrawable
28 * strct = GdkGLDrawable
46 * - GdkGLContext* -> GLContext
50 module glgdk
.GLDrawable
;
52 private import glgdk
.glgdktypes
;
54 private import lib
.glgdk
;
56 private import glgdk
.GLContext
;
61 public class GLDrawable
64 /** the main Gtk struct */
65 protected GdkGLDrawable
* gdkGLDrawable
;
68 public GdkGLDrawable
* getGLDrawableStruct()
74 /** the main Gtk struct as a void* */
75 protected void* getStruct()
77 return cast(void*)gdkGLDrawable
;
81 * Sets our main struct and passes it to the parent class
83 public this (GdkGLDrawable
* gdkGLDrawable
)
85 this.gdkGLDrawable
= gdkGLDrawable
;
93 * Attach an OpenGL rendering context to a gldrawable.
94 * gldrawable : a GdkGLDrawable.
95 * glcontext : a GdkGLContext.
96 * Returns : TRUE if it is successful, FALSE otherwise.
98 public int makeCurrent(GLContext glcontext
)
100 // gboolean gdk_gl_drawable_make_current (GdkGLDrawable *gldrawable, GdkGLContext *glcontext);
101 return gdk_gl_drawable_make_current(gdkGLDrawable
, (glcontext
is null) ?
null : glcontext
.getGLContextStruct());
105 * Returns whether the gldrawable supports the double-buffered visual.
106 * gldrawable : a GdkGLDrawable.
107 * Returns : TRUE if the double-buffered visual is supported,
110 public int isDoubleBuffered()
112 // gboolean gdk_gl_drawable_is_double_buffered (GdkGLDrawable *gldrawable);
113 return gdk_gl_drawable_is_double_buffered(gdkGLDrawable
);
117 * Exchange front and back buffers.
118 * gldrawable : a GdkGLDrawable.
120 public void swapBuffers()
122 // void gdk_gl_drawable_swap_buffers (GdkGLDrawable *gldrawable);
123 gdk_gl_drawable_swap_buffers(gdkGLDrawable
);
127 * Complete OpenGL execution prior to subsequent GDK drawing calls.
128 * gldrawable : a GdkGLDrawable.
132 // void gdk_gl_drawable_wait_gl (GdkGLDrawable *gldrawable);
133 gdk_gl_drawable_wait_gl(gdkGLDrawable
);
137 * Complete GDK drawing execution prior to subsequent OpenGL calls.
138 * gldrawable : a GdkGLDrawable.
140 public void waitGdk()
142 // void gdk_gl_drawable_wait_gdk (GdkGLDrawable *gldrawable);
143 gdk_gl_drawable_wait_gdk(gdkGLDrawable
);
147 * Delimits the begining of the OpenGL execution.
148 * gldrawable : a GdkGLDrawable.
149 * glcontext : a GdkGLContext.
150 * Returns : TRUE if it is successful, FALSE otherwise.
152 public int glBegin(GLContext glcontext
)
154 // gboolean gdk_gl_drawable_gl_begin (GdkGLDrawable *gldrawable, GdkGLContext *glcontext);
155 return gdk_gl_drawable_gl_begin(gdkGLDrawable
, (glcontext
is null) ?
null : glcontext
.getGLContextStruct());
159 * Delimits the end of the OpenGL execution.
160 * gldrawable : a GdkGLDrawable.
164 // void gdk_gl_drawable_gl_end (GdkGLDrawable *gldrawable);
165 gdk_gl_drawable_gl_end(gdkGLDrawable
);
169 * Gets GdkGLConfig with which the gldrawable is configured.
170 * gldrawable : a GdkGLDrawable.
171 * Returns : the GdkGLConfig.
173 public GdkGLConfig
* getGLConfig()
175 // GdkGLConfig* gdk_gl_drawable_get_gl_config (GdkGLDrawable *gldrawable);
176 return gdk_gl_drawable_get_gl_config(gdkGLDrawable
);
180 * Fills *width and *height with the size of GL drawable.
181 * width or height can be NULL if you only want the other one.
182 * gldrawable : a GdkGLDrawable.
183 * width : location to store drawable's width, or NULL.
184 * height : location to store drawable's height, or NULL.
186 public void getSize(int* width
, int* height
)
188 // void gdk_gl_drawable_get_size (GdkGLDrawable *gldrawable, gint *width, gint *height);
189 gdk_gl_drawable_get_size(gdkGLDrawable
, width
, height
);
193 * Returns the current GdkGLDrawable.
194 * Returns : the current GdkGLDrawable or NULL if there is no current drawable.
195 * << Rendering ContextOpenGL Pixmap >>
197 public static GdkGLDrawable
* getCurrent()
199 // GdkGLDrawable* gdk_gl_drawable_get_current (void);
200 return gdk_gl_drawable_get_current();