Merge lp:~unity-team/clutk/clutk.perspective-icon into lp:clutk
- clutk.perspective-icon
- Merge into trunk
Proposed by
Jay Taoko
Status: | Merged |
---|---|
Approved by: | Mirco Müller |
Approved revision: | 263 |
Merged at revision: | 269 |
Proposed branch: | lp:~unity-team/clutk/clutk.perspective-icon |
Merge into: | lp:clutk |
Diff against target: |
916 lines (+690/-13) 15 files modified
.bzrignore (+2/-0) clutk/Makefile.am (+2/-0) clutk/clutk.h (+1/-0) clutk/ctk-arb-asm-private.h (+3/-1) clutk/ctk-main.c (+8/-1) clutk/ctk-perspective-correct-rendering.c (+423/-0) clutk/ctk-perspective-correct-rendering.h (+74/-0) data/shaders/Makefile.am (+3/-1) data/shaders/TextureProgramUVDivision.fparb (+38/-0) data/shaders/TextureProgramUVDivision_2Tex.fparb (+41/-0) data/shaders/shaders.h (+3/-0) gtk-doc.make (+4/-10) vapi/clutk-0.3.gi (+58/-0) vapi/clutk-0.3.metadata (+5/-0) vapi/clutk-0.3.vapi (+25/-0) |
To merge this branch: | bzr merge lp:~unity-team/clutk/clutk.perspective-icon |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mirco Müller (community) | Approve | ||
Review via email: mp+33865@code.launchpad.net |
Commit message
Description of the change
Support for perspective correction of icons in the launcher. Solves the distorted texture problem.
To post a comment you must log in.
Revision history for this message
Mirco Müller (macslow) wrote : | # |
Revision history for this message
Mirco Müller (macslow) wrote : | # |
Looks good. Approved. But a small stand-alone test-app for the test-suite would have been nice.
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file '.bzrignore' |
2 | --- .bzrignore 2010-08-01 18:46:57 +0000 |
3 | +++ .bzrignore 2010-08-27 03:00:57 +0000 |
4 | @@ -474,3 +474,5 @@ |
5 | data/shaders/TextureMask.fparb.h |
6 | data/shaders/TextureProgram.fparb.h |
7 | data/shaders/VertexProgram.vparb.h |
8 | +data/shaders/TextureProgramUVDivision.fparb.h |
9 | +data/shaders/TextureProgramUVDivision_2Tex.fparb.h |
10 | |
11 | === modified file 'clutk/Makefile.am' |
12 | --- clutk/Makefile.am 2010-08-25 09:15:18 +0000 |
13 | +++ clutk/Makefile.am 2010-08-27 03:00:57 +0000 |
14 | @@ -34,6 +34,7 @@ |
15 | $(srcdir)/ctk-menu-expandable.h \ |
16 | $(srcdir)/ctk-menu-item.h \ |
17 | $(srcdir)/ctk-menu-seperator.h \ |
18 | + $(srcdir)/ctk-perspective-correct-rendering.h \ |
19 | $(srcdir)/ctk-radio-menu-item.h \ |
20 | $(srcdir)/ctk-render-target.h \ |
21 | $(srcdir)/ctk-scroll-view.h \ |
22 | @@ -155,6 +156,7 @@ |
23 | $(srcdir)/ctk-menu-expandable.c \ |
24 | $(srcdir)/ctk-menu-item.c \ |
25 | $(srcdir)/ctk-menu-seperator.c \ |
26 | + $(srcdir)/ctk-perspective-correct-rendering.c \ |
27 | $(srcdir)/ctk-private.h \ |
28 | $(srcdir)/ctk-radio-menu-item.c \ |
29 | $(srcdir)/ctk-render-target.c \ |
30 | |
31 | === modified file 'clutk/clutk.h' |
32 | --- clutk/clutk.h 2010-07-27 21:04:51 +0000 |
33 | +++ clutk/clutk.h 2010-08-27 03:00:57 +0000 |
34 | @@ -49,6 +49,7 @@ |
35 | #include <clutk/ctk-menu-expandable.h> |
36 | #include <clutk/ctk-menu-item.h> |
37 | #include <clutk/ctk-menu-seperator.h> |
38 | +#include <clutk/ctk-perspective-correct-rendering.h> |
39 | #include <clutk/ctk-radio-menu-item.h> |
40 | #include <clutk/ctk-render-target.h> |
41 | #include <clutk/ctk-scroll-view.h> |
42 | |
43 | === modified file 'clutk/ctk-arb-asm-private.h' |
44 | --- clutk/ctk-arb-asm-private.h 2010-07-11 04:04:19 +0000 |
45 | +++ clutk/ctk-arb-asm-private.h 2010-08-27 03:00:57 +0000 |
46 | @@ -68,6 +68,8 @@ |
47 | ShaderProgramASM* g_shMultipassBlur_asm; |
48 | ShaderProgramASM* g_shTextureMask_asm; |
49 | ShaderProgramASM* g_shTextureColorMask_asm; |
50 | +ShaderProgramASM* g_shTextureUVPerspDivision_asm; |
51 | +ShaderProgramASM* g_shTextureUVPerspDivision_2Tex_asm; |
52 | |
53 | /* ARB program */ |
54 | ShaderProgramASM* ctk_create_shader_asm_program_from_source(const char* vtx_filename, const char* frag_filename); |
55 | @@ -202,7 +204,7 @@ |
56 | gint window_w, |
57 | gint window_h, |
58 | gfloat opacity); |
59 | - |
60 | + |
61 | G_END_DECLS |
62 | |
63 | #endif /* _CTK_ASM_ARB_PRIVATE_H_ */ |
64 | |
65 | === modified file 'clutk/ctk-main.c' |
66 | --- clutk/ctk-main.c 2010-07-05 16:36:28 +0000 |
67 | +++ clutk/ctk-main.c 2010-08-27 03:00:57 +0000 |
68 | @@ -268,6 +268,8 @@ |
69 | g_shMultipassBlur_asm = ctk_create_shader_asm_program_from_source (VertexProgram_vparb, MultipassBlur_fparb); |
70 | g_shTextureMask_asm = ctk_create_shader_asm_program_from_source (VertexProgram_vparb, TextureMask_fparb); |
71 | g_shTextureColorMask_asm = ctk_create_shader_asm_program_from_source (VertexProgram_vparb, TextureColorMask_fparb); |
72 | + g_shTextureUVPerspDivision_asm = ctk_create_shader_asm_program_from_source (VertexProgram_vparb, TextureProgramUVDivision_fparb); |
73 | + g_shTextureUVPerspDivision_2Tex_asm = ctk_create_shader_asm_program_from_source (VertexProgram_vparb, TextureProgramUVDivision_2Tex_fparb); |
74 | } |
75 | else |
76 | { |
77 | @@ -277,6 +279,8 @@ |
78 | g_shExp_asm = 0; |
79 | g_shMultipassBlur_asm = 0; |
80 | g_shTextureMask_asm = 0; |
81 | + g_shTextureUVPerspDivision_asm = 0; |
82 | + g_shTextureUVPerspDivision_2Tex_asm = 0; |
83 | } |
84 | |
85 | if (!(g_shTexture_asm && |
86 | @@ -284,7 +288,9 @@ |
87 | g_shBlur_asm && |
88 | g_shExp_asm && |
89 | g_shMultipassBlur_asm && |
90 | - g_shTextureMask_asm)) |
91 | + g_shTextureMask_asm && |
92 | + g_shTextureUVPerspDivision_asm && |
93 | + g_shTextureUVPerspDivision_2Tex_asm)) |
94 | { |
95 | /* Not all shaders compiled succesfully */ |
96 | all_asm_shaders_compiled_and_ready = FALSE; |
97 | @@ -632,6 +638,7 @@ |
98 | ctk_delete_shader_asm_program (g_shExp_asm); |
99 | ctk_delete_shader_asm_program (g_shMultipassBlur_asm); |
100 | ctk_delete_shader_asm_program (g_shTextureMask_asm); |
101 | + ctk_delete_shader_asm_program (g_shTextureUVPerspDivision_asm); |
102 | } |
103 | |
104 | gboolean |
105 | |
106 | === added file 'clutk/ctk-perspective-correct-rendering.c' |
107 | --- clutk/ctk-perspective-correct-rendering.c 1970-01-01 00:00:00 +0000 |
108 | +++ clutk/ctk-perspective-correct-rendering.c 2010-08-27 03:00:57 +0000 |
109 | @@ -0,0 +1,423 @@ |
110 | +/* |
111 | + * Copyright 2009 Canonical Ltd. |
112 | + * |
113 | + * This program is free software: you can redistribute it and/or modify it |
114 | + * under the terms of either or both of the following licenses: |
115 | + * |
116 | + * 1) the GNU Lesser General Public License version 3, as published by the |
117 | + * Free Software Foundation; and/or |
118 | + * 2) the GNU Lesser General Public License version 2.1, as published by |
119 | + * the Free Software Foundation. |
120 | + * |
121 | + * This program is distributed in the hope that it will be useful, but |
122 | + * WITHOUT ANY WARRANTY; without even the implied warranties of |
123 | + * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR |
124 | + * PURPOSE. See the applicable version of the GNU Lesser General Public |
125 | + * License for more details. |
126 | + * |
127 | + * You should have received a copy of both the GNU Lesser General Public |
128 | + * License version 3 and version 2.1 along with this program. If not, see |
129 | + * <http://www.gnu.org/licenses/> |
130 | + * |
131 | + * Authored by: Jay Taoko <jay.taoko@canonical.com> |
132 | + * |
133 | + */ |
134 | +/** |
135 | + * SECTION:ctk-perspective-correct-rendering |
136 | + * @short_description: Renders a polygon's projected vertices and apply the perspective correction to texture coordinates. |
137 | + * |
138 | + * Utility functions |
139 | + */ |
140 | + |
141 | +#include <stdlib.h> |
142 | +#include <stdio.h> |
143 | +#include <fcntl.h> |
144 | +#include <unistd.h> |
145 | +#include <math.h> |
146 | +#include <string.h> |
147 | + |
148 | +#include <GL/glew.h> |
149 | +#include <GL/glxew.h> |
150 | + |
151 | +#include <clutter/clutter.h> |
152 | +#include "ctk-utils.h" |
153 | +#include "ctk-arb-asm-private.h" |
154 | +#include "ctk-perspective-correct-rendering.h" |
155 | +#include <gio/gio.h> |
156 | + |
157 | +/** |
158 | + * ctk_render_projected_polygon |
159 | + * |
160 | + * @V: An array of CtkProjectedTextureVertex |
161 | + * @tex_id: OpenGL texture id |
162 | + * @window_w: width of the stage (width of window) |
163 | + * @window_h: height of the stage (height of window) |
164 | + **/ |
165 | +void ctk_render_projected_polygon (CtkProjectedTextureVertex *V, guint tex_id, gint window_w, gint window_h) |
166 | +{ |
167 | + gfloat VtxBuffer[] = { |
168 | + // X Y Z W S T R Q R G B A |
169 | + V[0].x, V[0].y, V[0].z, 1.0f, V[0].s/V[0].w, V[0].t/V[0].w, V[0].r/V[0].w, V[0].q/V[0].w, V[0].color.red/255.0f, V[0].color.green/255.0f, V[0].color.blue/255.0f, V[0].color.alpha/255.0f, |
170 | + V[1].x, V[1].y, V[1].z, 1.0f, V[1].s/V[1].w, V[1].t/V[1].w, V[1].r/V[1].w, V[1].q/V[1].w, V[1].color.red/255.0f, V[1].color.green/255.0f, V[1].color.blue/255.0f, V[1].color.alpha/255.0f, |
171 | + V[2].x, V[2].y, V[2].z, 1.0f, V[2].s/V[2].w, V[2].t/V[2].w, V[2].r/V[2].w, V[2].q/V[2].w, V[2].color.red/255.0f, V[2].color.green/255.0f, V[2].color.blue/255.0f, V[2].color.alpha/255.0f, |
172 | + V[3].x, V[3].y, V[3].z, 1.0f, V[3].s/V[3].w, V[3].t/V[3].w, V[3].r/V[3].w, V[3].q/V[3].w, V[3].color.red/255.0f, V[3].color.green/255.0f, V[3].color.blue/255.0f, V[3].color.alpha/255.0f, |
173 | + }; |
174 | + |
175 | +// printf("V0: %f, %f, %f, %f \n", V[0].x, V[0].y, V[0].z, V[0].w); |
176 | +// printf("V1: %f, %f, %f, %f \n", V[1].x, V[1].y, V[1].z, V[1].w); |
177 | +// printf("V2: %f, %f, %f, %f \n", V[2].x, V[2].y, V[2].z, V[2].w); |
178 | +// printf("V3: %f, %f, %f, %f \n", V[3].x, V[3].y, V[3].z, V[3].w); |
179 | +// gfloat VtxBuffer[] = { |
180 | +// // X Y Z W U0 V0 R G B A |
181 | +// 5, 26, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, |
182 | +// 5, 76, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, |
183 | +// 55, 76, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, |
184 | +// 55, 26, 0.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, |
185 | +// }; |
186 | + |
187 | + gint VertexLocation = ATTRIB_POSITION; |
188 | + gint TextureCoord0Location = ATTRIB_COLOR_TEXCOORD0; |
189 | + gint VertexColorLocation = ATTRIB_COLOR; |
190 | + |
191 | + CHECKGL(glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0)); |
192 | + CHECKGL(glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0)); |
193 | + |
194 | + // Use the shader |
195 | + { |
196 | + CHECKGL( glEnable(GL_VERTEX_PROGRAM_ARB) ); |
197 | + CHECKGL( glBindProgramARB(GL_VERTEX_PROGRAM_ARB, g_shTextureUVPerspDivision_asm->shvert) ); |
198 | + CHECKGL( glEnable(GL_FRAGMENT_PROGRAM_ARB) ); |
199 | + CHECKGL( glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, g_shTextureUVPerspDivision_asm->shfrag) ); |
200 | + } |
201 | + |
202 | + CHECKGL( glEnableVertexAttribArrayARB (VertexLocation) ); |
203 | + CHECKGL( glVertexAttribPointerARB ((GLuint)VertexLocation, 4, GL_FLOAT, GL_FALSE, 48, VtxBuffer) ); |
204 | + |
205 | + if(TextureCoord0Location != -1) |
206 | + { |
207 | + CHECKGL( glEnableVertexAttribArrayARB (TextureCoord0Location) ); |
208 | + CHECKGL( glVertexAttribPointerARB ((GLuint)TextureCoord0Location, 4, GL_FLOAT, GL_FALSE, 48, VtxBuffer + 4) ); |
209 | + } |
210 | + |
211 | + if(VertexColorLocation != -1) |
212 | + { |
213 | + CHECKGL( glEnableVertexAttribArrayARB (VertexColorLocation) ); |
214 | + CHECKGL( glVertexAttribPointerARB ((GLuint)VertexColorLocation, 4, GL_FLOAT, GL_FALSE, 48, VtxBuffer + 8) ); |
215 | + } |
216 | + |
217 | + CHECKGL( glActiveTextureARB(GL_TEXTURE0) ); |
218 | + CHECKGL( glEnable (GL_TEXTURE_2D) ); |
219 | + CHECKGL( glBindTexture(GL_TEXTURE_2D, tex_id) ); |
220 | + |
221 | + // Preserve model-view and projection matrices |
222 | + { |
223 | + CHECKGL( glMatrixMode(GL_PROJECTION) ); |
224 | + CHECKGL( glPushMatrix() ); |
225 | + CHECKGL( glLoadIdentity() ); |
226 | + CHECKGL( glOrtho(0, window_w, window_h, 0, -1, 1) ); |
227 | + |
228 | + CHECKGL( glMatrixMode(GL_MODELVIEW) ); |
229 | + CHECKGL( glPushMatrix() ); |
230 | + CHECKGL( glLoadIdentity() ); |
231 | + } |
232 | + |
233 | + gint blend; |
234 | + gint blend_src; |
235 | + gint blend_dst; |
236 | + glGetIntegerv(GL_BLEND, &blend); |
237 | + glGetIntegerv(GL_BLEND_SRC, &blend_src); |
238 | + glGetIntegerv(GL_BLEND_DST, &blend_dst); |
239 | + |
240 | + glEnable(GL_BLEND); |
241 | + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
242 | + |
243 | + //CHECKGL( glDrawArrays(GL_QUADS, 0, 4) ); |
244 | + glBegin(GL_QUADS); |
245 | + glColor4f(V[0].color.red/255.0f, V[0].color.green/255.0f, V[0].color.blue/255.0f, V[0].color.alpha/255.0f); |
246 | + glMultiTexCoord4f(GL_TEXTURE0, V[0].s/V[0].w, V[0].t/V[0].w, V[0].r/V[0].w, V[0].q/V[0].w); |
247 | + glVertex4f(V[0].x, V[0].y, V[0].z, 1.0f); |
248 | + |
249 | + glColor4f(V[1].color.red/255.0f, V[1].color.green/255.0f, V[1].color.blue/255.0f, V[1].color.alpha/255.0f); |
250 | + glMultiTexCoord4f(GL_TEXTURE0, V[1].s/V[1].w, V[1].t/V[1].w, V[1].r/V[1].w, V[1].q/V[1].w); |
251 | + glVertex4f(V[1].x, V[1].y, V[1].z, 1.0f); |
252 | + |
253 | + glColor4f(V[2].color.red/255.0f, V[2].color.green/255.0f, V[2].color.blue/255.0f, V[2].color.alpha/255.0f); |
254 | + glMultiTexCoord4f(GL_TEXTURE0, V[2].s/V[2].w, V[2].t/V[2].w, V[2].r/V[2].w, V[2].q/V[2].w); |
255 | + glVertex4f(V[2].x, V[2].y, V[2].z, 1.0f); |
256 | + |
257 | + glColor4f(V[3].color.red/255.0f, V[3].color.green/255.0f, V[3].color.blue/255.0f, V[3].color.alpha/255.0f); |
258 | + glMultiTexCoord4f(GL_TEXTURE0, V[3].s/V[3].w, V[3].t/V[3].w, V[3].r/V[3].w, V[3].q/V[3].w); |
259 | + glVertex4f(V[3].x, V[3].y, V[3].z, 1.0f); |
260 | + glEnd(); |
261 | + |
262 | + // Restore model-view and projection matrices |
263 | + { |
264 | + CHECKGL( glMatrixMode(GL_PROJECTION) ); |
265 | + CHECKGL( glPopMatrix() ); |
266 | + CHECKGL( glMatrixMode(GL_MODELVIEW) ); |
267 | + CHECKGL( glPopMatrix() ); |
268 | + } |
269 | + |
270 | + glBlendFunc(blend_src, blend_dst); |
271 | + |
272 | + CHECKGL( glDisableVertexAttribArrayARB(VertexLocation) ); |
273 | + if(TextureCoord0Location != -1) |
274 | + CHECKGL( glDisableVertexAttribArrayARB(TextureCoord0Location) ); |
275 | + if(VertexColorLocation != -1) |
276 | + CHECKGL( glDisableVertexAttribArrayARB(VertexColorLocation) ); |
277 | + |
278 | + |
279 | + // Stop using the shader program |
280 | + CHECKGL( glDisable(GL_VERTEX_PROGRAM_ARB) ); |
281 | + CHECKGL( glDisable(GL_FRAGMENT_PROGRAM_ARB) ); |
282 | +} |
283 | + |
284 | +/** |
285 | + * ctk_render_projected_polygon |
286 | + * |
287 | + * @V: An array of CtkProjectedTextureVertex |
288 | + * @tex_mask_id: OpenGL texture id |
289 | + * @window_w: width of the stage (width of window) |
290 | + * @window_h: height of the stage (height of window) |
291 | + **/ |
292 | +void ctk_render_projected_polygon_2Tex (CtkProjectedTextureVertex *V, guint tex_mask_id, guint tex_id, gint window_w, gint window_h) |
293 | +{ |
294 | + gfloat VtxBuffer[] = { |
295 | + // X Y Z W S T R Q R G B A |
296 | + V[0].x, V[0].y, V[0].z, 1.0f, V[0].s/V[0].w, V[0].t/V[0].w, V[0].r/V[0].w, V[0].q/V[0].w, V[0].color.red/255.0f, V[0].color.green/255.0f, V[0].color.blue/255.0f, V[0].color.alpha/255.0f, |
297 | + V[1].x, V[1].y, V[1].z, 1.0f, V[1].s/V[1].w, V[1].t/V[1].w, V[1].r/V[1].w, V[1].q/V[1].w, V[1].color.red/255.0f, V[1].color.green/255.0f, V[1].color.blue/255.0f, V[1].color.alpha/255.0f, |
298 | + V[2].x, V[2].y, V[2].z, 1.0f, V[2].s/V[2].w, V[2].t/V[2].w, V[2].r/V[2].w, V[2].q/V[2].w, V[2].color.red/255.0f, V[2].color.green/255.0f, V[2].color.blue/255.0f, V[2].color.alpha/255.0f, |
299 | + V[3].x, V[3].y, V[3].z, 1.0f, V[3].s/V[3].w, V[3].t/V[3].w, V[3].r/V[3].w, V[3].q/V[3].w, V[3].color.red/255.0f, V[3].color.green/255.0f, V[3].color.blue/255.0f, V[3].color.alpha/255.0f, |
300 | + }; |
301 | + |
302 | +// printf("V0: %f, %f, %f, %f \n", V[0].x, V[0].y, V[0].z, V[0].w); |
303 | +// printf("V1: %f, %f, %f, %f \n", V[1].x, V[1].y, V[1].z, V[1].w); |
304 | +// printf("V2: %f, %f, %f, %f \n", V[2].x, V[2].y, V[2].z, V[2].w); |
305 | +// printf("V3: %f, %f, %f, %f \n", V[3].x, V[3].y, V[3].z, V[3].w); |
306 | +// gfloat VtxBuffer[] = { |
307 | +// // X Y Z W U0 V0 R G B A |
308 | +// 5, 26, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, |
309 | +// 5, 76, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, |
310 | +// 55, 76, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, |
311 | +// 55, 26, 0.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, |
312 | +// }; |
313 | + |
314 | + gint VertexLocation = ATTRIB_POSITION; |
315 | + gint TextureCoord0Location = ATTRIB_COLOR_TEXCOORD0; |
316 | + gint VertexColorLocation = ATTRIB_COLOR; |
317 | + |
318 | + CHECKGL(glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0)); |
319 | + CHECKGL(glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0)); |
320 | + |
321 | + // Use the shader |
322 | + { |
323 | + CHECKGL( glEnable(GL_VERTEX_PROGRAM_ARB) ); |
324 | + CHECKGL( glBindProgramARB(GL_VERTEX_PROGRAM_ARB, g_shTextureUVPerspDivision_2Tex_asm->shvert) ); |
325 | + CHECKGL( glEnable(GL_FRAGMENT_PROGRAM_ARB) ); |
326 | + CHECKGL( glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, g_shTextureUVPerspDivision_2Tex_asm->shfrag) ); |
327 | + } |
328 | + |
329 | + CHECKGL( glEnableVertexAttribArrayARB (VertexLocation) ); |
330 | + CHECKGL( glVertexAttribPointerARB ((GLuint)VertexLocation, 4, GL_FLOAT, GL_FALSE, 48, VtxBuffer) ); |
331 | + |
332 | + if(TextureCoord0Location != -1) |
333 | + { |
334 | + CHECKGL( glEnableVertexAttribArrayARB (TextureCoord0Location) ); |
335 | + CHECKGL( glVertexAttribPointerARB ((GLuint)TextureCoord0Location, 4, GL_FLOAT, GL_FALSE, 48, VtxBuffer + 4) ); |
336 | + } |
337 | + |
338 | + if(VertexColorLocation != -1) |
339 | + { |
340 | + CHECKGL( glEnableVertexAttribArrayARB (VertexColorLocation) ); |
341 | + CHECKGL( glVertexAttribPointerARB ((GLuint)VertexColorLocation, 4, GL_FLOAT, GL_FALSE, 48, VtxBuffer + 8) ); |
342 | + } |
343 | + |
344 | + CHECKGL( glActiveTextureARB(GL_TEXTURE0) ); |
345 | + CHECKGL( glEnable (GL_TEXTURE_2D) ); |
346 | + CHECKGL( glBindTexture(GL_TEXTURE_2D, tex_mask_id) ); |
347 | + |
348 | + CHECKGL( glActiveTextureARB(GL_TEXTURE1) ); |
349 | + CHECKGL( glEnable (GL_TEXTURE_2D) ); |
350 | + CHECKGL( glBindTexture(GL_TEXTURE_2D, tex_id) ); |
351 | + |
352 | + // Preserve model-view and projection matrices |
353 | + { |
354 | + CHECKGL( glMatrixMode(GL_PROJECTION) ); |
355 | + CHECKGL( glPushMatrix() ); |
356 | + CHECKGL( glLoadIdentity() ); |
357 | + CHECKGL( glOrtho(0, window_w, window_h, 0, -1, 1) ); |
358 | + |
359 | + CHECKGL( glMatrixMode(GL_MODELVIEW) ); |
360 | + CHECKGL( glPushMatrix() ); |
361 | + CHECKGL( glLoadIdentity() ); |
362 | + } |
363 | + |
364 | + gint blend; |
365 | + gint blend_src; |
366 | + gint blend_dst; |
367 | + glGetIntegerv(GL_BLEND, &blend); |
368 | + glGetIntegerv(GL_BLEND_SRC, &blend_src); |
369 | + glGetIntegerv(GL_BLEND_DST, &blend_dst); |
370 | + |
371 | + glEnable(GL_BLEND); |
372 | + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
373 | + |
374 | + //CHECKGL( glDrawArrays(GL_QUADS, 0, 4) ); |
375 | + glBegin(GL_QUADS); |
376 | + glColor4f(V[0].color.red/255.0f, V[0].color.green/255.0f, V[0].color.blue/255.0f, V[0].color.alpha/255.0f); |
377 | + glMultiTexCoord4f(GL_TEXTURE0, V[0].s/V[0].w, V[0].t/V[0].w, V[0].r/V[0].w, V[0].q/V[0].w); |
378 | + glVertex4f(V[0].x, V[0].y, V[0].z, 1.0f); |
379 | + |
380 | + glColor4f(V[1].color.red/255.0f, V[1].color.green/255.0f, V[1].color.blue/255.0f, V[1].color.alpha/255.0f); |
381 | + glMultiTexCoord4f(GL_TEXTURE0, V[1].s/V[1].w, V[1].t/V[1].w, V[1].r/V[1].w, V[1].q/V[1].w); |
382 | + glVertex4f(V[1].x, V[1].y, V[1].z, 1.0f); |
383 | + |
384 | + glColor4f(V[2].color.red/255.0f, V[2].color.green/255.0f, V[2].color.blue/255.0f, V[2].color.alpha/255.0f); |
385 | + glMultiTexCoord4f(GL_TEXTURE0, V[2].s/V[2].w, V[2].t/V[2].w, V[2].r/V[2].w, V[2].q/V[2].w); |
386 | + glVertex4f(V[2].x, V[2].y, V[2].z, 1.0f); |
387 | + |
388 | + glColor4f(V[3].color.red/255.0f, V[3].color.green/255.0f, V[3].color.blue/255.0f, V[3].color.alpha/255.0f); |
389 | + glMultiTexCoord4f(GL_TEXTURE0, V[3].s/V[3].w, V[3].t/V[3].w, V[3].r/V[3].w, V[3].q/V[3].w); |
390 | + glVertex4f(V[3].x, V[3].y, V[3].z, 1.0f); |
391 | + glEnd(); |
392 | + |
393 | + // Restore model-view and projection matrices |
394 | + { |
395 | + CHECKGL( glMatrixMode(GL_PROJECTION) ); |
396 | + CHECKGL( glPopMatrix() ); |
397 | + CHECKGL( glMatrixMode(GL_MODELVIEW) ); |
398 | + CHECKGL( glPopMatrix() ); |
399 | + } |
400 | + |
401 | + glBlendFunc(blend_src, blend_dst); |
402 | + |
403 | + CHECKGL( glDisableVertexAttribArrayARB(VertexLocation) ); |
404 | + if(TextureCoord0Location != -1) |
405 | + CHECKGL( glDisableVertexAttribArrayARB(TextureCoord0Location) ); |
406 | + if(VertexColorLocation != -1) |
407 | + CHECKGL( glDisableVertexAttribArrayARB(VertexColorLocation) ); |
408 | + |
409 | + CHECKGL( glActiveTextureARB(GL_TEXTURE1) ); |
410 | + CHECKGL( glDisable (GL_TEXTURE_2D) ); |
411 | + |
412 | + // Stop using the shader program |
413 | + CHECKGL( glDisable(GL_VERTEX_PROGRAM_ARB) ); |
414 | + CHECKGL( glDisable(GL_FRAGMENT_PROGRAM_ARB) ); |
415 | +} |
416 | + |
417 | +void ctk_get_actor_screen_coord (CtkActor* actor, gfloat *x, gfloat *y, gfloat *width, gfloat *height) |
418 | +{ |
419 | + gfloat actor_screen_width, actor_screen_height; |
420 | + gfloat actor_screen_x, actor_screen_y; |
421 | + |
422 | + ClutterVertex vtx[4]; |
423 | + ctk_get_actor_screen_position (CTK_ACTOR(actor), |
424 | + &actor_screen_x, |
425 | + &actor_screen_y, |
426 | + &actor_screen_width, |
427 | + &actor_screen_height, vtx); |
428 | + |
429 | + *x = actor_screen_x; |
430 | + *y = actor_screen_y; |
431 | + *width = actor_screen_width; |
432 | + *height = actor_screen_height; |
433 | +} |
434 | + |
435 | +/** |
436 | + * ctk_create_opengl_texture_from_pixbuf |
437 | + * |
438 | + * GdkPixbuf: a GdkPixbuf of the image |
439 | + * |
440 | + **/ |
441 | + |
442 | +guint ctk_create_opengl_texture_from_pixbuf (GdkPixbuf *pixbuf) |
443 | +{ |
444 | + g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), 0); |
445 | + |
446 | + guint opengl_id = 0; |
447 | + int unpack = 0; |
448 | + unsigned char *pixelbuffer = 0; |
449 | + pixelbuffer = gdk_pixbuf_get_pixels(pixbuf); |
450 | + |
451 | + int texture_width = gdk_pixbuf_get_width(pixbuf); |
452 | + int texture_height = gdk_pixbuf_get_height(pixbuf); |
453 | + |
454 | + gint nChannel = gdk_pixbuf_get_n_channels(pixbuf); |
455 | + |
456 | + CHECKGL (glGetIntegerv(GL_UNPACK_ALIGNMENT, &unpack)); |
457 | + CHECKGL (glPixelStorei(GL_UNPACK_ALIGNMENT, 4)); |
458 | + CHECKGL (glPixelStorei(GL_UNPACK_ROW_LENGTH, 0)); |
459 | + CHECKGL (glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, 0)); |
460 | + CHECKGL (glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0)); |
461 | + CHECKGL (glPixelStorei(GL_UNPACK_SKIP_ROWS, 0)); |
462 | + |
463 | + CHECKGL (glActiveTextureARB (GL_TEXTURE0)); |
464 | + |
465 | + CHECKGL (glGenTextures (1, &opengl_id)); |
466 | + |
467 | + CHECKGL (glBindTexture (GL_TEXTURE_2D, opengl_id)); |
468 | + |
469 | + if (nChannel == 3) |
470 | + { |
471 | + CHECKGL (glTexImage2D (GL_TEXTURE_2D, |
472 | + 0, |
473 | + GL_RGB, |
474 | + (gint) texture_width, |
475 | + (gint) texture_height, |
476 | + 0, |
477 | + GL_RGB, |
478 | + GL_UNSIGNED_BYTE, |
479 | + pixelbuffer)); |
480 | + } |
481 | + else |
482 | + { |
483 | + CHECKGL (glTexImage2D (GL_TEXTURE_2D, |
484 | + 0, |
485 | + GL_RGBA8, |
486 | + (gint) texture_width, |
487 | + (gint) texture_height, |
488 | + 0, |
489 | + GL_RGBA, |
490 | + GL_UNSIGNED_BYTE, |
491 | + pixelbuffer)); |
492 | + } |
493 | + |
494 | + CHECKGL (glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)); |
495 | + CHECKGL (glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)); |
496 | + CHECKGL (glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP)); |
497 | + CHECKGL (glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP)); |
498 | + |
499 | + return opengl_id; |
500 | +} |
501 | +/** |
502 | + * ctk_create_opengl_texture_from_file |
503 | + * |
504 | + * filename: filename of the texture to read |
505 | + * texture_width: width of the texture |
506 | + * texture_height: height of the texture |
507 | + **/ |
508 | +guint ctk_create_opengl_texture_from_file (const char* filename) |
509 | +{ |
510 | + g_return_val_if_fail (filename, 0); |
511 | + |
512 | + GError *error = 0; |
513 | + GdkPixbuf* pixbuf = gdk_pixbuf_new_from_file (filename, &error); |
514 | + if (error != 0) |
515 | + { |
516 | + g_warning("[ctk_create_opengl_texture_from_file] %s() at line %s: Invalid pixbuf", G_STRFUNC, G_STRLOC); |
517 | + return 0; |
518 | + } |
519 | + return ctk_create_opengl_texture_from_pixbuf (pixbuf); |
520 | +} |
521 | + |
522 | +/** |
523 | + * ctk_delete_opengl_texture |
524 | + * |
525 | + * @opengl_texture_id: OpenGL texture id to delete |
526 | + **/ |
527 | +void ctk_delete_opengl_texture (guint opengl_texture_id) |
528 | +{ |
529 | + if (opengl_texture_id != 0) |
530 | + CHECKGL (glDeleteTextures (1, &opengl_texture_id)); |
531 | +} |
532 | + |
533 | |
534 | === added file 'clutk/ctk-perspective-correct-rendering.h' |
535 | --- clutk/ctk-perspective-correct-rendering.h 1970-01-01 00:00:00 +0000 |
536 | +++ clutk/ctk-perspective-correct-rendering.h 2010-08-27 03:00:57 +0000 |
537 | @@ -0,0 +1,74 @@ |
538 | +/* |
539 | + * Copyright 2009 Canonical Ltd. |
540 | + * |
541 | + * This program is free software: you can redistribute it and/or modify it |
542 | + * under the terms of either or both of the following licenses: |
543 | + * |
544 | + * 1) the GNU Lesser General Public License version 3, as published by the |
545 | + * Free Software Foundation; and/or |
546 | + * 2) the GNU Lesser General Public License version 2.1, as published by |
547 | + * the Free Software Foundation. |
548 | + * |
549 | + * This program is distributed in the hope that it will be useful, but |
550 | + * WITHOUT ANY WARRANTY; without even the implied warranties of |
551 | + * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR |
552 | + * PURPOSE. See the applicable version of the GNU Lesser General Public |
553 | + * License for more details. |
554 | + * |
555 | + * You should have received a copy of both the GNU Lesser General Public |
556 | + * License version 3 and version 2.1 along with this program. If not, see |
557 | + * <http://www.gnu.org/licenses/> |
558 | + * |
559 | + * Authored by: Jay Taoko <jay.taoko@canonical.com> |
560 | + * |
561 | + */ |
562 | + |
563 | +#ifndef _CTK_PERSPECTIVE_CORRECT_RENDERING_H_ |
564 | +#define _CTK_PERSPECTIVE_CORRECT_RENDERING_H_ |
565 | + |
566 | +#include <glib.h> |
567 | +#include <clutter/clutter.h> |
568 | +#include <clutk/ctk-utils.h> |
569 | +#include <clutk/ctk-actor.h> |
570 | +#include <clutk/ctk-render-target.h> |
571 | +#include <clutk/ctk-effect-context.h> |
572 | + |
573 | +G_BEGIN_DECLS |
574 | + |
575 | + |
576 | + |
577 | +typedef struct _CtkProjectedTextureVertex CtkProjectedTextureVertex; |
578 | + |
579 | +/** |
580 | + * CtkProjectedTextureVertex: |
581 | + * @x: projected x coord |
582 | + * @y: projected y coord |
583 | + * @z: projected z coord |
584 | + * @w: w coord from the perspective transformation |
585 | + * @s: texture coordinate |
586 | + * @t: texture coordinate |
587 | + * @r: texture coordinate |
588 | + * @q: texture coordinate |
589 | + * @color: Color at the vertex |
590 | + */ |
591 | +struct _CtkProjectedTextureVertex |
592 | +{ |
593 | + gfloat x, y, z, w; |
594 | + gfloat s, t, r, q; |
595 | + CoglColor color; |
596 | +}; |
597 | + |
598 | + |
599 | +void ctk_render_projected_polygon (CtkProjectedTextureVertex *V, guint tex_mask_id, gint window_w, gint window_h); |
600 | +void ctk_render_projected_polygon_2Tex (CtkProjectedTextureVertex *V, guint tex_mask_id, guint tex_id, gint window_w, gint window_h); |
601 | + |
602 | +void ctk_get_actor_screen_coord (CtkActor* actor, gfloat *x, gfloat *y, gfloat *width, gfloat *height); |
603 | + |
604 | +guint ctk_create_opengl_texture_from_pixbuf (GdkPixbuf *pixbuf); |
605 | +guint ctk_create_opengl_texture_from_file (const char* filename); |
606 | + |
607 | +void ctk_delete_opengl_texture (guint opengl_texture_id); |
608 | + |
609 | +G_END_DECLS |
610 | + |
611 | +#endif /* _CTK_PERSPECTIVE_CORRECT_RENDERING_H_ */ |
612 | |
613 | === modified file 'data/shaders/Makefile.am' |
614 | --- data/shaders/Makefile.am 2010-07-05 16:36:28 +0000 |
615 | +++ data/shaders/Makefile.am 2010-08-27 03:00:57 +0000 |
616 | @@ -20,7 +20,9 @@ |
617 | TextureMask.fparb.h \ |
618 | TextureColorMask.fparb.h \ |
619 | TextureProgram.fparb.h \ |
620 | - VertexProgram.vparb.h |
621 | + VertexProgram.vparb.h \ |
622 | + TextureProgramUVDivision.fparb.h \ |
623 | + TextureProgramUVDivision_2Tex.fparb.h |
624 | |
625 | %.fparb.h: %.fparb Makefile |
626 | echo "const char * $(subst .,_,$(basename $@)) = " > $@ |
627 | |
628 | === added file 'data/shaders/TextureProgramUVDivision.fparb' |
629 | --- data/shaders/TextureProgramUVDivision.fparb 1970-01-01 00:00:00 +0000 |
630 | +++ data/shaders/TextureProgramUVDivision.fparb 2010-08-27 03:00:57 +0000 |
631 | @@ -0,0 +1,38 @@ |
632 | +!!ARBfp1.0 |
633 | + |
634 | +################################################################################### |
635 | +# |
636 | +# Copyright 2009 Canonical Ltd. |
637 | +# |
638 | +# This program is free software: you can redistribute it and/or modify it |
639 | +# under the terms of either or both of the following licenses: |
640 | +# |
641 | +# 1) the GNU Lesser General Public License version 3, as published by the |
642 | +# Free Software Foundation; and/or |
643 | +# 2) the GNU Lesser General Public License version 2.1, as published by |
644 | +# the Free Software Foundation. |
645 | +# |
646 | +# This program is distributed in the hope that it will be useful, but |
647 | +# WITHOUT ANY WARRANTY; without even the implied warranties of |
648 | +# MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR |
649 | +# PURPOSE. See the applicable version of the GNU Lesser General Public |
650 | +# License for more details. |
651 | +# |
652 | +# You should have received a copy of both the GNU Lesser General Public |
653 | +# License version 3 and version 2.1 along with this program. If not, see |
654 | +# <http://www.gnu.org/licenses/> |
655 | +# |
656 | +# Authored by: Canonical Ltd |
657 | +# |
658 | +################################################################################### |
659 | + |
660 | +TEMP tex0; |
661 | +TEMP coord; |
662 | +TEMP coord1; |
663 | +RCP coord1, fragment.texcoord[0].w; |
664 | +MOV coord, {1, 1, 1, 1}; |
665 | +MUL coord.xy, fragment.texcoord[0], coord1; |
666 | +TEX tex0, coord, texture[0], 2D; |
667 | +MUL result.color, tex0, fragment.color.primary; |
668 | +END |
669 | + |
670 | |
671 | === added file 'data/shaders/TextureProgramUVDivision_2Tex.fparb' |
672 | --- data/shaders/TextureProgramUVDivision_2Tex.fparb 1970-01-01 00:00:00 +0000 |
673 | +++ data/shaders/TextureProgramUVDivision_2Tex.fparb 2010-08-27 03:00:57 +0000 |
674 | @@ -0,0 +1,41 @@ |
675 | +!!ARBfp1.0 |
676 | + |
677 | +################################################################################### |
678 | +# |
679 | +# Copyright 2009 Canonical Ltd. |
680 | +# |
681 | +# This program is free software: you can redistribute it and/or modify it |
682 | +# under the terms of either or both of the following licenses: |
683 | +# |
684 | +# 1) the GNU Lesser General Public License version 3, as published by the |
685 | +# Free Software Foundation; and/or |
686 | +# 2) the GNU Lesser General Public License version 2.1, as published by |
687 | +# the Free Software Foundation. |
688 | +# |
689 | +# This program is distributed in the hope that it will be useful, but |
690 | +# WITHOUT ANY WARRANTY; without even the implied warranties of |
691 | +# MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR |
692 | +# PURPOSE. See the applicable version of the GNU Lesser General Public |
693 | +# License for more details. |
694 | +# |
695 | +# You should have received a copy of both the GNU Lesser General Public |
696 | +# License version 3 and version 2.1 along with this program. If not, see |
697 | +# <http://www.gnu.org/licenses/> |
698 | +# |
699 | +# Authored by: Canonical Ltd |
700 | +# |
701 | +################################################################################### |
702 | + |
703 | +TEMP tex0; |
704 | +TEMP tex1; |
705 | +TEMP coord; |
706 | +TEMP coord1; |
707 | +RCP coord1, fragment.texcoord[0].w; |
708 | +MOV coord, {1, 1, 1, 1}; |
709 | +MUL coord.xy, fragment.texcoord[0], coord1; |
710 | +TEX tex0, coord, texture[0], 2D; |
711 | +TEX tex1, coord, texture[1], 2D; |
712 | +MUL tex0, tex0, fragment.color.primary; |
713 | +MUL result.color, tex0, tex1; |
714 | +END |
715 | + |
716 | |
717 | === modified file 'data/shaders/shaders.h' |
718 | --- data/shaders/shaders.h 2010-07-05 16:36:28 +0000 |
719 | +++ data/shaders/shaders.h 2010-08-27 03:00:57 +0000 |
720 | @@ -6,3 +6,6 @@ |
721 | #include "TextureColorMask.fparb.h" |
722 | #include "TextureProgram.fparb.h" |
723 | #include "VertexProgram.vparb.h" |
724 | +#include "TextureProgramUVDivision.fparb.h" |
725 | +#include "TextureProgramUVDivision_2Tex.fparb.h" |
726 | + |
727 | |
728 | === modified file 'gtk-doc.make' |
729 | --- gtk-doc.make 2010-08-18 11:27:40 +0000 |
730 | +++ gtk-doc.make 2010-08-27 03:00:57 +0000 |
731 | @@ -75,11 +75,8 @@ |
732 | scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) |
733 | @echo 'gtk-doc: Scanning header files' |
734 | @-chmod -R u+w $(srcdir) |
735 | - @_source_dir='' ; for i in $(DOC_SOURCE_DIR) ; do \ |
736 | - _source_dir="$${_source_dir} --source-dir=$$i" ; \ |
737 | - done ; \ |
738 | - cd $(srcdir) && \ |
739 | - gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) |
740 | + @cd $(srcdir) && \ |
741 | + gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES) |
742 | @if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \ |
743 | CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \ |
744 | else \ |
745 | @@ -112,11 +109,8 @@ |
746 | sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) |
747 | @echo 'gtk-doc: Building XML' |
748 | @-chmod -R u+w $(srcdir) |
749 | - @_source_dir='' ; for i in $(DOC_SOURCE_DIR) ; do \ |
750 | - _source_dir="$${_source_dir} --source-dir=$$i" ; \ |
751 | - done ; \ |
752 | - cd $(srcdir) && \ |
753 | - gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) |
754 | + @cd $(srcdir) && \ |
755 | + gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS) |
756 | @touch sgml-build.stamp |
757 | |
758 | sgml.stamp: sgml-build.stamp |
759 | |
760 | === modified file 'vapi/clutk-0.3.gi' |
761 | --- vapi/clutk-0.3.gi 2010-07-29 17:02:29 +0000 |
762 | +++ vapi/clutk-0.3.gi 2010-08-27 03:00:57 +0000 |
763 | @@ -12,6 +12,24 @@ |
764 | <function name="cleanup" symbol="ctk_cleanup"> |
765 | <return-type type="void"/> |
766 | </function> |
767 | + <function name="create_opengl_texture_from_file" symbol="ctk_create_opengl_texture_from_file"> |
768 | + <return-type type="guint"/> |
769 | + <parameters> |
770 | + <parameter name="filename" type="char*"/> |
771 | + </parameters> |
772 | + </function> |
773 | + <function name="create_opengl_texture_from_pixbuf" symbol="ctk_create_opengl_texture_from_pixbuf"> |
774 | + <return-type type="guint"/> |
775 | + <parameters> |
776 | + <parameter name="pixbuf" type="GdkPixbuf*"/> |
777 | + </parameters> |
778 | + </function> |
779 | + <function name="delete_opengl_texture" symbol="ctk_delete_opengl_texture"> |
780 | + <return-type type="void"/> |
781 | + <parameters> |
782 | + <parameter name="opengl_texture_id" type="guint"/> |
783 | + </parameters> |
784 | + </function> |
785 | <function name="dnd_init" symbol="ctk_dnd_init"> |
786 | <return-type type="void"/> |
787 | <parameters> |
788 | @@ -54,6 +72,16 @@ |
789 | <parameter name="em_value" type="gdouble"/> |
790 | </parameters> |
791 | </function> |
792 | + <function name="get_actor_screen_coord" symbol="ctk_get_actor_screen_coord"> |
793 | + <return-type type="void"/> |
794 | + <parameters> |
795 | + <parameter name="actor" type="CtkActor*"/> |
796 | + <parameter name="x" type="gfloat*"/> |
797 | + <parameter name="y" type="gfloat*"/> |
798 | + <parameter name="width" type="gfloat*"/> |
799 | + <parameter name="height" type="gfloat*"/> |
800 | + </parameters> |
801 | + </function> |
802 | <function name="init" symbol="ctk_init"> |
803 | <return-type type="void"/> |
804 | <parameters> |
805 | @@ -74,6 +102,25 @@ |
806 | <parameter name="pixel_value" type="gint"/> |
807 | </parameters> |
808 | </function> |
809 | + <function name="render_projected_polygon" symbol="ctk_render_projected_polygon"> |
810 | + <return-type type="void"/> |
811 | + <parameters> |
812 | + <parameter name="V" type="CtkProjectedTextureVertex*"/> |
813 | + <parameter name="tex_mask_id" type="guint"/> |
814 | + <parameter name="window_w" type="gint"/> |
815 | + <parameter name="window_h" type="gint"/> |
816 | + </parameters> |
817 | + </function> |
818 | + <function name="render_projected_polygon_2Tex" symbol="ctk_render_projected_polygon_2Tex"> |
819 | + <return-type type="void"/> |
820 | + <parameters> |
821 | + <parameter name="V" type="CtkProjectedTextureVertex*"/> |
822 | + <parameter name="tex_mask_id" type="guint"/> |
823 | + <parameter name="tex_id" type="guint"/> |
824 | + <parameter name="window_w" type="gint"/> |
825 | + <parameter name="window_h" type="gint"/> |
826 | + </parameters> |
827 | + </function> |
828 | <function name="surface_blur" symbol="ctk_surface_blur"> |
829 | <return-type type="void"/> |
830 | <parameters> |
831 | @@ -89,6 +136,17 @@ |
832 | </callback> |
833 | <struct name="CtkBoxChild"> |
834 | </struct> |
835 | + <struct name="CtkProjectedTextureVertex"> |
836 | + <field name="x" type="gfloat"/> |
837 | + <field name="y" type="gfloat"/> |
838 | + <field name="z" type="gfloat"/> |
839 | + <field name="w" type="gfloat"/> |
840 | + <field name="s" type="gfloat"/> |
841 | + <field name="t" type="gfloat"/> |
842 | + <field name="r" type="gfloat"/> |
843 | + <field name="q" type="gfloat"/> |
844 | + <field name="color" type="CoglColor"/> |
845 | + </struct> |
846 | <boxed name="CtkPadding" type-name="CtkPadding" get-type="ctk_padding_get_type"> |
847 | <field name="top" type="gfloat"/> |
848 | <field name="right" type="gfloat"/> |
849 | |
850 | === modified file 'vapi/clutk-0.3.metadata' |
851 | --- vapi/clutk-0.3.metadata 2010-02-23 11:11:51 +0000 |
852 | +++ vapi/clutk-0.3.metadata 2010-08-27 03:00:57 +0000 |
853 | @@ -7,3 +7,8 @@ |
854 | ctk_init_after.argv is_array="1" is_ref="1" array_length_pos="0.9" |
855 | ctk_actor_get_stored_allocation.box is_out="1" |
856 | ctk_actor_recurse_get_stored_allocation_box.box is_out="1" |
857 | +ctk_get_actor_screen_coord.x is_out="1" |
858 | +ctk_get_actor_screen_coord.y is_out="1" |
859 | +ctk_get_actor_screen_coord.width is_out="1" |
860 | +ctk_get_actor_screen_coord.height is_out="1" |
861 | + |
862 | |
863 | === modified file 'vapi/clutk-0.3.vapi' |
864 | --- vapi/clutk-0.3.vapi 2010-07-29 17:02:29 +0000 |
865 | +++ vapi/clutk-0.3.vapi 2010-08-27 03:00:57 +0000 |
866 | @@ -391,6 +391,19 @@ |
867 | [CCode (has_construct_function = false)] |
868 | public MenuSeperator (); |
869 | } |
870 | + [Compact] |
871 | + [CCode (cheader_filename = "clutk/clutk.h")] |
872 | + public class ProjectedTextureVertex { |
873 | + public Cogl.Color color; |
874 | + public float q; |
875 | + public float r; |
876 | + public float s; |
877 | + public float t; |
878 | + public float w; |
879 | + public float x; |
880 | + public float y; |
881 | + public float z; |
882 | + } |
883 | [CCode (cheader_filename = "clutk/clutk.h")] |
884 | public class RadioMenuItem : Ctk.CheckMenuItem, Clutter.Scriptable, Ctk.Focusable, Clutter.Container { |
885 | [CCode (has_construct_function = false)] |
886 | @@ -583,6 +596,12 @@ |
887 | [CCode (cheader_filename = "clutk/clutk.h")] |
888 | public static void cleanup (); |
889 | [CCode (cheader_filename = "clutk/clutk.h")] |
890 | + public static uint create_opengl_texture_from_file (string filename); |
891 | + [CCode (cheader_filename = "clutk/clutk.h")] |
892 | + public static uint create_opengl_texture_from_pixbuf (Gdk.Pixbuf pixbuf); |
893 | + [CCode (cheader_filename = "clutk/clutk.h")] |
894 | + public static void delete_opengl_texture (uint opengl_texture_id); |
895 | + [CCode (cheader_filename = "clutk/clutk.h")] |
896 | public static void dnd_init (Gtk.Widget widget, Gtk.TargetEntry[] targets); |
897 | [CCode (cheader_filename = "clutk/clutk.h")] |
898 | public static Gdk.Atom drag_dest_find_target (Gdk.DragContext context, Gtk.TargetList target_list); |
899 | @@ -595,11 +614,17 @@ |
900 | [CCode (cheader_filename = "clutk/clutk.h")] |
901 | public static double em_to_pixel (double em_value); |
902 | [CCode (cheader_filename = "clutk/clutk.h")] |
903 | + public static void get_actor_screen_coord (Ctk.Actor actor, out float x, out float y, out float width, out float height); |
904 | + [CCode (cheader_filename = "clutk/clutk.h")] |
905 | public static void init ([CCode (array_length_pos = 0.9)] ref unowned string[] argv); |
906 | [CCode (cheader_filename = "clutk/clutk.h")] |
907 | public static void init_after ([CCode (array_length_pos = 0.9)] ref unowned string[] argv); |
908 | [CCode (cheader_filename = "clutk/clutk.h")] |
909 | public static double pixel_to_em (int pixel_value); |
910 | [CCode (cheader_filename = "clutk/clutk.h")] |
911 | + public static void render_projected_polygon (Ctk.ProjectedTextureVertex V, uint tex_mask_id, int window_w, int window_h); |
912 | + [CCode (cheader_filename = "clutk/clutk.h")] |
913 | + public static void render_projected_polygon_2Tex (Ctk.ProjectedTextureVertex V, uint tex_mask_id, uint tex_id, int window_w, int window_h); |
914 | + [CCode (cheader_filename = "clutk/clutk.h")] |
915 | public static void surface_blur (Cairo.Surface surface, uint radius); |
916 | } |
I think you forgot to mark this branch to be a prerequisite for lp:~unity-team/unity/unity.perspective-icon