alternative to assert
[gtkD.git] / gtkD / srcgl / glgdk / GLWindow.d
blob6e09b5335cf072ffae92d691453d7470bdf02676
1 /*
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-gdkglwindow.html
26 * outPack = glgdk
27 * outFile = GLWindow
28 * strct = GdkGLWindow
29 * realStrct=
30 * ctorStrct=
31 * clss = GLWindow
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gdk_gl_window_
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * imports:
44 * - glgdk.GLConfig
45 * structWrap:
46 * - GdkGLCondif* -> GLConfig
47 * module aliases:
48 * local aliases:
51 module glgdk.GLWindow;
53 version(noAssert)
55 version(Tango)
57 import tango.io.Stdout; // use the tango loging?
61 private import gtkglc.glgdktypes;
63 private import gtkglc.glgdk;
66 private import glgdk.GLConfig;
71 /**
72 * Description
74 private import gdk.Drawable;
75 public class GLWindow : Drawable
78 /** the main Gtk struct */
79 protected GdkGLWindow* gdkGLWindow;
82 public GdkGLWindow* getGLWindowStruct()
84 return gdkGLWindow;
88 /** the main Gtk struct as a void* */
89 protected void* getStruct()
91 return cast(void*)gdkGLWindow;
94 /**
95 * Sets our main struct and passes it to the parent class
97 public this (GdkGLWindow* gdkGLWindow)
99 version(noAssert)
101 if ( gdkGLWindow is null )
103 int zero = 0;
104 version(Tango)
106 Stdout("struct gdkGLWindow is null on constructor").newline;
108 else
110 printf("struct gdkGLWindow is null on constructor");
112 zero = zero / zero;
115 else
117 assert(gdkGLWindow !is null, "struct gdkGLWindow is null on constructor");
119 super(cast(GdkDrawable*)gdkGLWindow);
120 this.gdkGLWindow = gdkGLWindow;
128 * Creates an on-screen rendering area.
129 * attrib_list is currently unused. This must be set to NULL or empty
130 * (first attribute of None). See GLX 1.3 spec.
131 * glconfig:
132 * a GdkGLConfig.
133 * window:
134 * the GdkWindow to be used as the rendering area.
135 * attrib_list:
136 * this must be set to NULL or empty (first attribute of None).
137 * Returns:
138 * the new GdkGLWindow.
140 public this (GdkGLConfig* glconfig, GdkWindow* window, int* attribList)
142 // GdkGLWindow* gdk_gl_window_new (GdkGLConfig *glconfig, GdkWindow *window, const int *attrib_list);
143 this(cast(GdkGLWindow*)gdk_gl_window_new(glconfig, window, attribList) );
147 * Destroys the OpenGL resources associated with glwindow and
148 * decrements glwindow's reference count.
149 * glwindow:
150 * a GdkGLWindow.
152 public void destroy()
154 // void gdk_gl_window_destroy (GdkGLWindow *glwindow);
155 gdk_gl_window_destroy(gdkGLWindow);
159 * Returns the GdkWindow associated with glwindow.
160 * Notice that GdkGLWindow is not GdkWindow, but another
161 * GdkDrawable which have an associated GdkWindow.
162 * glwindow:
163 * a GdkGLWindow.
164 * Returns:
165 * the GdkWindow associated with glwindow.
167 public GdkWindow* getWindow()
169 // GdkWindow* gdk_gl_window_get_window (GdkGLWindow *glwindow);
170 return gdk_gl_window_get_window(gdkGLWindow);
174 * Set the OpenGL-capability to the window.
175 * This function creates a new GdkGLWindow held by the window.
176 * attrib_list is currently unused. This must be set to NULL or empty
177 * (first attribute of None).
178 * window:
179 * the GdkWindow to be used as the rendering area.
180 * glconfig:
181 * a GdkGLConfig.
182 * attrib_list:
183 * this must be set to NULL or empty (first attribute of None).
184 * Returns:
185 * the GdkGLWindow used by the window if it is successful,
186 * NULL otherwise.
188 public static GdkGLWindow* gdkWindowSetGLCapability(GdkWindow* window, GdkGLConfig* glconfig, int* attribList)
190 // GdkGLWindow* gdk_window_set_gl_capability (GdkWindow *window, GdkGLConfig *glconfig, const int *attrib_list);
191 return gdk_window_set_gl_capability(window, glconfig, attribList);
195 * Unset the OpenGL-capability of the window.
196 * This function destroys the GdkGLWindow held by the window.
197 * window:
198 * a GdkWindow.
200 public static void gdkWindowUnsetGLCapability(GdkWindow* window)
202 // void gdk_window_unset_gl_capability (GdkWindow *window);
203 gdk_window_unset_gl_capability(window);
207 * Returns whether the window is OpenGL-capable.
208 * window:
209 * a GdkWindow.
210 * Returns:
211 * TRUE if the window is OpenGL-capable, FALSE otherwise.
213 public static int gdkWindowIsGLCapable(GdkWindow* window)
215 // gboolean gdk_window_is_gl_capable (GdkWindow *window);
216 return gdk_window_is_gl_capable(window);
220 * Returns the GdkGLWindow held by the window.
221 * window:
222 * a GdkWindow.
223 * Returns:
224 * the GdkGLWindow.
226 public static GdkGLWindow* gdkWindowGetGLWindow(GdkWindow* window)
228 // GdkGLWindow* gdk_window_get_gl_window (GdkWindow *window);
229 return gdk_window_get_gl_window(window);