I've no idea here...
[gtkD.git] / srcgl / glgdk / GLDrawable.d
blobb4df1a8aaf4aa8983b87b44aa755582cd9f68dfe
1 /*
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
26 * outPack = glgdk
27 * outFile = GLDrawable
28 * strct = GdkGLDrawable
29 * realStrct=
30 * ctorStrct=
31 * clss = GLDrawable
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gdk_gl_drawable_
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * imports:
44 * - glgdk.GLContext
45 * structWrap:
46 * - GdkGLContext* -> GLContext
47 * local aliases:
50 module glgdk.GLDrawable;
52 private import glgdk.glgdktypes;
54 private import lib.glgdk;
56 private import glgdk.GLContext;
58 /**
59 * Description
61 public class GLDrawable
64 /** the main Gtk struct */
65 protected GdkGLDrawable* gdkGLDrawable;
68 public GdkGLDrawable* getGLDrawableStruct()
70 return gdkGLDrawable;
74 /** the main Gtk struct as a void* */
75 protected void* getStruct()
77 return cast(void*)gdkGLDrawable;
80 /**
81 * Sets our main struct and passes it to the parent class
83 public this (GdkGLDrawable* gdkGLDrawable)
85 this.gdkGLDrawable = gdkGLDrawable;
88 /**
92 /**
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,
108 * FALSE otherwise.
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.
130 public void waitGl()
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.
162 public void glEnd()
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();