1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19  
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 /*
25  * Conversion parameters:
26  * inFile  = gtkglext-gdkgldrawable.html
27  * outPack = glgdk
28  * outFile = GLDrawableT
29  * strct   = GdkGLDrawable
30  * realStrct=
31  * ctorStrct=
32  * clss    = GLDrawableT
33  * interf  = GLDrawableIF
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * 	- TStruct
38  * extend  = 
39  * implements:
40  * prefixes:
41  * 	- gdk_gl_drawable_
42  * omit structs:
43  * omit prefixes:
44  * omit code:
45  * omit signals:
46  * imports:
47  * 	- glgdk.GLConfig
48  * structWrap:
49  * 	- GdkGLConfig* -> GLConfig
50  * module aliases:
51  * local aliases:
52  * overrides:
53  */
54 
55 module glgdk.GLDrawableT;
56 
57 public  import gtkglc.glgdktypes;
58 
59 public import gtkglc.glgdk;
60 public import glib.ConstructionException;
61 public import gobject.ObjectG;
62 
63 
64 public import glgdk.GLConfig;
65 
66 
67 
68 
69 /**
70  */
71 public template GLDrawableT(TStruct)
72 {
73 	
74 	/** the main Gtk struct */
75 	protected GdkGLDrawable* gdkGLDrawable;
76 	
77 	
78 	public GdkGLDrawable* getGLDrawableTStruct()
79 	{
80 		return cast(GdkGLDrawable*)getStruct();
81 	}
82 	
83 	
84 	/**
85 	 */
86 	
87 	/**
88 	 * Returns whether the gldrawable supports the double-buffered visual.
89 	 * Returns: TRUE if the double-buffered visual is supported, FALSE otherwise.
90 	 */
91 	public int isDoubleBuffered()
92 	{
93 		// gboolean gdk_gl_drawable_is_double_buffered (GdkGLDrawable *gldrawable);
94 		return gdk_gl_drawable_is_double_buffered(getGLDrawableTStruct());
95 	}
96 	
97 	/**
98 	 * Exchange front and back buffers.
99 	 */
100 	public void swapBuffers()
101 	{
102 		// void gdk_gl_drawable_swap_buffers (GdkGLDrawable *gldrawable);
103 		gdk_gl_drawable_swap_buffers(getGLDrawableTStruct());
104 	}
105 	
106 	/**
107 	 * Complete OpenGL execution prior to subsequent GDK drawing calls.
108 	 */
109 	public void waitGl()
110 	{
111 		// void gdk_gl_drawable_wait_gl (GdkGLDrawable *gldrawable);
112 		gdk_gl_drawable_wait_gl(getGLDrawableTStruct());
113 	}
114 	
115 	/**
116 	 * Complete GDK drawing execution prior to subsequent OpenGL calls.
117 	 */
118 	public void waitGdk()
119 	{
120 		// void gdk_gl_drawable_wait_gdk (GdkGLDrawable *gldrawable);
121 		gdk_gl_drawable_wait_gdk(getGLDrawableTStruct());
122 	}
123 	
124 	/**
125 	 * Gets GdkGLConfig with which the gldrawable is configured.
126 	 * Returns: the GdkGLConfig.
127 	 */
128 	public GLConfig getGLConfig()
129 	{
130 		// GdkGLConfig * gdk_gl_drawable_get_gl_config (GdkGLDrawable *gldrawable);
131 		auto p = gdk_gl_drawable_get_gl_config(getGLDrawableTStruct());
132 		
133 		if(p is null)
134 		{
135 			return null;
136 		}
137 		
138 		return ObjectG.getDObject!(GLConfig)(cast(GdkGLConfig*) p);
139 	}
140 }