summaryrefslogtreecommitdiff
path: root/legacy/evas
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2009-11-13 11:30:28 +0000
committerCarsten Haitzler <raster@rasterman.com>2009-11-13 11:30:28 +0000
commit39913889b36287efe170d177cf5c265a7c6e8eb4 (patch)
tree32f6b17901add1dd751c61db1b66f2f418b6a7c5 /legacy/evas
parent267c9bce6c622f2ade632fae142b9a65eae6e2de (diff)
fix gles defs
SVN revision: 43660
Diffstat (limited to 'legacy/evas')
-rw-r--r--legacy/evas/src/modules/engines/gl_common/evas_gl_context.c21
-rw-r--r--legacy/evas/src/modules/engines/gl_common/evas_gl_texture.c32
2 files changed, 25 insertions, 28 deletions
diff --git a/legacy/evas/src/modules/engines/gl_common/evas_gl_context.c b/legacy/evas/src/modules/engines/gl_common/evas_gl_context.c
index 65bf696927..ae470c8118 100644
--- a/legacy/evas/src/modules/engines/gl_common/evas_gl_context.c
+++ b/legacy/evas/src/modules/engines/gl_common/evas_gl_context.c
@@ -304,24 +304,21 @@ evas_gl_common_context_target_surface_set(Evas_GL_Context *gc,
304 evas_gl_common_context_flush(gc); 304 evas_gl_common_context_flush(gc);
305 305
306 gc->shader.surface = surface; 306 gc->shader.surface = surface;
307#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
308 // FIXME: XXX render-to-texture for gles2
309#else
310 // FIXME: viewport goopies
311 gc->change.size = 1; 307 gc->change.size = 1;
312#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX) 308#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
313 if (gc->shader.surface == gc->def_surface) 309# ifndef GL_FRAMEBUFFER
314 glBindFramebuffer(GL_FRAMEBUFFER_OES, 0); 310# define GL_FRAMEBUFFER GL_FRAMEBUFFER_OES
315 else 311# endif
316 glBindFramebuffer(GL_FRAMEBUFFER_OES, surface->tex->pt->fb);
317#else 312#else
313# ifndef GL_FRAMEBUFFER
314# define GL_FRAMEBUFFER GL_FRAMEBUFFER_EXT
315# endif
316#endif
318 if (gc->shader.surface == gc->def_surface) 317 if (gc->shader.surface == gc->def_surface)
319 glBindFramebuffer(GL_FRAMEBUFFER_EXT, 0); 318 glBindFramebuffer(GL_FRAMEBUFFER, 0);
320 else 319 else
321 glBindFramebuffer(GL_FRAMEBUFFER_EXT, surface->tex->pt->fb); 320 glBindFramebuffer(GL_FRAMEBUFFER, surface->tex->pt->fb);
322#endif
323 _evas_gl_common_viewport_set(gc); 321 _evas_gl_common_viewport_set(gc);
324#endif
325} 322}
326 323
327#define PUSH_VERTEX(x, y, z) \ 324#define PUSH_VERTEX(x, y, z) \
diff --git a/legacy/evas/src/modules/engines/gl_common/evas_gl_texture.c b/legacy/evas/src/modules/engines/gl_common/evas_gl_texture.c
index e74ce00a62..ccd538be1a 100644
--- a/legacy/evas/src/modules/engines/gl_common/evas_gl_texture.c
+++ b/legacy/evas/src/modules/engines/gl_common/evas_gl_texture.c
@@ -269,19 +269,20 @@ _pool_tex_render_new(Evas_GL_Context *gc, int w, int h, int intformat, int forma
269 pt->dataformat = GL_UNSIGNED_BYTE; 269 pt->dataformat = GL_UNSIGNED_BYTE;
270 pt->references = 0; 270 pt->references = 0;
271#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX) 271#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
272 glGenTextures(1, &(pt->texture)); 272# ifndef GL_FRAMEBUFFER
273 glBindTexture(GL_TEXTURE_2D, pt->texture); 273# define GL_FRAMEBUFFER GL_FRAMEBUFFER_OES
274 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); 274# endif
275 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); 275# ifndef GL_COLOR_ATTACHMENT0
276 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 276# define GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_OES
277 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 277# endif
278 _tex_2d(pt->intformat, w, h, pt->format, pt->dataformat);
279 glGenFramebuffers(1, &(pt->fb));
280 glBindFramebuffer(GL_FRAMEBUFFER_OES, pt->fb);
281 glFramebufferTexture2DEXT(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_TEXTURE_2D, pt->texture, 0);
282 glBindFramebufferEXT(GL_FRAMEBUFFER_OES, 0);
283 glBindTexture(GL_TEXTURE_2D, gc->shader.cur_tex);
284#else 278#else
279# ifndef GL_FRAMEBUFFER
280# define GL_FRAMEBUFFER GL_FRAMEBUFFER_EXT
281# endif
282# ifndef GL_COLOR_ATTACHMENT0
283# define GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_EXT
284# endif
285#endif
285 glGenTextures(1, &(pt->texture)); 286 glGenTextures(1, &(pt->texture));
286 glBindTexture(GL_TEXTURE_2D, pt->texture); 287 glBindTexture(GL_TEXTURE_2D, pt->texture);
287 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); 288 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
@@ -290,11 +291,10 @@ _pool_tex_render_new(Evas_GL_Context *gc, int w, int h, int intformat, int forma
290 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 291 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
291 _tex_2d(pt->intformat, w, h, pt->format, pt->dataformat); 292 _tex_2d(pt->intformat, w, h, pt->format, pt->dataformat);
292 glGenFramebuffers(1, &(pt->fb)); 293 glGenFramebuffers(1, &(pt->fb));
293 glBindFramebuffer(GL_FRAMEBUFFER_EXT, pt->fb); 294 glBindFramebuffer(GL_FRAMEBUFFER, pt->fb);
294 glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, pt->texture, 0); 295 glFramebufferTexture2DEXT(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, pt->texture, 0);
295 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); 296 glBindFramebufferEXT(GL_FRAMEBUFFER, 0);
296 glBindTexture(GL_TEXTURE_2D, gc->shader.cur_tex); 297 glBindTexture(GL_TEXTURE_2D, gc->shader.cur_tex);
297#endif
298 return pt; 298 return pt;
299} 299}
300 300