Gtk changes on wrap. X11 on gdk. XID on glibtypes.
[gtkD.git] / srcgl / glgdk / GLContext.d
blob6d5bc563f387d9442f669d528439ae68b6fe2923
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-gdkglcontext.html
26 * outPack = glgdk
27 * outFile = GLContext
28 * strct = GdkGLContext
29 * realStrct=
30 * ctorStrct=
31 * clss = GLContext
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gdk_gl_context_
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * imports:
44 * - glgdk.GLDrawable
45 * structWrap:
46 * - GdkGLDrawable* -> GLDrawable
47 * local aliases:
50 module glgdk.GLContext;
52 private import glgdk.glgdktypes;
54 private import lib.glgdk;
56 private import glgdk.GLDrawable;
58 /**
59 * Description
61 private import gobject.ObjectG;
62 public class GLContext : ObjectG
65 /** the main Gtk struct */
66 protected GdkGLContext* gdkGLContext;
69 public GdkGLContext* getGLContextStruct()
71 return gdkGLContext;
75 /** the main Gtk struct as a void* */
76 protected void* getStruct()
78 return cast(void*)gdkGLContext;
81 /**
82 * Sets our main struct and passes it to the parent class
84 public this (GdkGLContext* gdkGLContext)
86 super(cast(GObject*)gdkGLContext);
87 this.gdkGLContext = gdkGLContext;
90 /**
94 /**
95 * Creates a new OpenGL rendering context.
96 * gldrawable : a GdkGLDrawable.
97 * share_list : the GdkGLContext with which to share display lists and texture
98 * objects. NULL indicates that no sharing is to take place.
99 * direct : whether rendering is to be done with a direct connection to
100 * the graphics system.
101 * render_type : GDK_GL_RGBA_TYPE or GDK_GL_COLOR_INDEX_TYPE (currently not
102 * used).
103 * Returns : the new GdkGLContext.
105 public this (GLDrawable gldrawable, GdkGLContext* shareList, int direct, int renderType)
107 // GdkGLContext* gdk_gl_context_new (GdkGLDrawable *gldrawable, GdkGLContext *share_list, gboolean direct, int render_type);
108 this(cast(GdkGLContext*)gdk_gl_context_new((gldrawable is null) ? null : gldrawable.getGLDrawableStruct(), shareList, direct, renderType) );
112 * Destroys the OpenGL resources associated with glcontext and
113 * decrements glcontext's reference count.
114 * glcontext : a GdkGLContext.
116 public void destroy()
118 // void gdk_gl_context_destroy (GdkGLContext *glcontext);
119 gdk_gl_context_destroy(gdkGLContext);
123 * Copy state from src rendering context to glcontext.
124 * mask contains the bitwise-OR of the same symbolic names that are passed to
125 * the glPushAttrib() function. You can use GL_ALL_ATTRIB_BITS to copy all the
126 * rendering state information.
127 * glcontext : a GdkGLContext.
128 * src : the source context.
129 * Param3 :
130 * Returns : FALSE if it fails, TRUE otherwise.
132 public int copy(GdkGLContext* src, ulong mask)
134 // gboolean gdk_gl_context_copy (GdkGLContext *glcontext, GdkGLContext *src, unsigned long mask);
135 return gdk_gl_context_copy(gdkGLContext, src, mask);
139 * Gets GdkGLDrawable to which the glcontext is bound.
140 * glcontext : a GdkGLContext.
141 * Returns : the GdkGLDrawable or NULL if no GdkGLDrawable is bound.
143 public GLDrawable getGLDrawable()
145 // GdkGLDrawable* gdk_gl_context_get_gl_drawable (GdkGLContext *glcontext);
146 return new GLDrawable( gdk_gl_context_get_gl_drawable(gdkGLContext) );
150 * Gets GdkGLConfig with which the glcontext is configured.
151 * glcontext : a GdkGLContext.
152 * Returns : the GdkGLConfig.
154 public GdkGLConfig* getGLConfig()
156 // GdkGLConfig* gdk_gl_context_get_gl_config (GdkGLContext *glcontext);
157 return gdk_gl_context_get_gl_config(gdkGLContext);
161 * Gets GdkGLContext with which the glcontext shares the display lists and
162 * texture objects.
163 * glcontext : a GdkGLContext.
164 * Returns : the GdkGLContext.
166 public GdkGLContext* getShareList()
168 // GdkGLContext* gdk_gl_context_get_share_list (GdkGLContext *glcontext);
169 return gdk_gl_context_get_share_list(gdkGLContext);
173 * Returns whether the glcontext is a direct rendering context.
174 * glcontext : a GdkGLContext.
175 * Returns : TRUE if the glcontext is a direct rendering contest.
177 public int isDirect()
179 // gboolean gdk_gl_context_is_direct (GdkGLContext *glcontext);
180 return gdk_gl_context_is_direct(gdkGLContext);
184 * Gets render_type of the glcontext.
185 * glcontext : a GdkGLContext.
186 * Returns : GDK_GL_RGBA_TYPE or GDK_GL_COLOR_INDEX_TYPE.
188 public int getRenderType()
190 // int gdk_gl_context_get_render_type (GdkGLContext *glcontext);
191 return gdk_gl_context_get_render_type(gdkGLContext);
195 * Returns the current GdkGLContext.
196 * Returns : the current GdkGLContext or NULL if there is no current
197 * context.
198 * << Frame Buffer ConfigurationRendering Surface >>
200 public static GdkGLContext* getCurrent()
202 // GdkGLContext* gdk_gl_context_get_current (void);
203 return gdk_gl_context_get_current();