Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/evas

Dir     : e17/libs/evas/src/lib/engines/gl_x11


Modified Files:
        evas_engine.c evas_x_main.c 


Log Message:


open gl is fulyl functional now - it coudl defnitely do with optimizations
with texture upload. it does NOt check error returns anywhere from gl... this
may mean issues with LOTs of images, LARGE images etc. need to fix that later

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/evas/src/lib/engines/gl_x11/evas_engine.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- evas_engine.c       5 Sep 2003 05:37:14 -0000       1.5
+++ evas_engine.c       9 Sep 2003 05:51:03 -0000       1.6
@@ -957,76 +957,28 @@
    Render_Engine *re;
 
    re = (Render_Engine *)data;
-//#define GL_TXT 1
-
-#ifdef GL_TXT   
      {
-       /* create output surface size ow x oh and scale to w x h */
-       RGBA_Draw_Context *dc;
        RGBA_Image *im;
        
-       dc = context;
-       im = evas_common_image_create(ow, oh);
-       if (im)
-         {
-            int max_ascent;
-            int i, j;
-            RGBA_Draw_Context *dct;
-            
-            im->flags |= RGBA_IMAGE_HAS_ALPHA;
-            j = ow * oh;
-            memset(im->image->data, 0, j * sizeof(DATA32));         
-            max_ascent = evas_common_font_max_ascent_get(font);             
-            dct = evas_common_draw_context_new();
-            if (dct)
-              {
-                 evas_common_draw_context_set_color(dct, 255, 255, 255, 255);
-                 evas_common_font_draw(im, dct, font, 0, max_ascent, text);
-                 evas_common_cpu_end_opt();
-                 evas_common_draw_context_free(dct);
-              }
-              {
-                 Evas_GL_Texture *tex;
-                 Evas_GL_Context *gc;
-                 double tx1, ty1, tx2, ty2;
-                 int r, g, b, a;
-                 
-                 gc = re->win->gl_context;
-                 tex = evas_gl_common_texture_new(gc, im, 0);
-                 evas_gl_common_context_texture_set(gc, tex, 0, w, h);
-                 tx1 = 0;
-                 ty1 = 0;
-                 tx2 = (double)(ow) / (double)(tex->w);
-                 ty2 = (double)(oh) / (double)(tex->h);
-                 a = (dc->col.col >> 24) & 0xff;
-                 r = (dc->col.col >> 16) & 0xff;
-                 g = (dc->col.col >> 8 ) & 0xff;
-                 b = (dc->col.col      ) & 0xff;
-                 evas_gl_common_context_color_set(gc, r, g, b, a);
-                 evas_gl_common_context_blend_set(gc, 1);
-                 if (dc->clip.use)
-                   evas_gl_common_context_clip_set(gc, 1,
-                                                   dc->clip.x, dc->clip.y,
-                                                   dc->clip.w, dc->clip.h);
-                 else
-                   evas_gl_common_context_clip_set(gc, 0,
-                                                   0, 0, 0, 0);
-                 evas_gl_common_context_read_buf_set(gc, GL_BACK);
-                 evas_gl_common_context_write_buf_set(gc, GL_BACK);
-                 
-                 glBegin(GL_QUADS);
-                 glTexCoord2d(tx1, ty1); glVertex2i(x    , y - ((max_ascent * h) / 
oh));
-                 glTexCoord2d(tx2, ty1); glVertex2i(x + w, y - ((max_ascent * h) / 
oh));
-                 glTexCoord2d(tx2, ty2); glVertex2i(x + w, y - ((max_ascent * h) / 
oh) + h);
-                 glTexCoord2d(tx1, ty2); glVertex2i(x    , y - ((max_ascent * h) / 
oh) + h);
-                 glEnd();
-                 
-                 evas_gl_common_texture_free(tex);
-              }
-            evas_common_image_free(im);
-         }
+       im = evas_common_image_new();
+       im->image = evas_common_image_surface_new();
+       im->image->w = re->win->w;
+       im->image->h = re->win->h;
+       im->image->data = NULL;
+       im->image->no_free = 1;
+       evas_common_draw_context_font_ext_set(context,
+                                             re->win->gl_context,
+                                             evas_gl_font_texture_new,
+                                             evas_gl_font_texture_free,
+                                             evas_gl_font_texture_draw);
+       evas_common_font_draw(im, context, font, x, y, text);
+       evas_common_draw_context_font_ext_set(context, 
+                                             NULL,
+                                             NULL, 
+                                             NULL,
+                                             NULL);
+       evas_common_image_free(im);
      }
-#endif   
 }
 
 static void
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/evas/src/lib/engines/gl_x11/evas_x_main.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- evas_x_main.c       5 Sep 2003 06:52:43 -0000       1.4
+++ evas_x_main.c       9 Sep 2003 05:51:03 -0000       1.5
@@ -67,7 +67,7 @@
 {
    if (gw == _evas_gl_x11_window) _evas_gl_x11_window = NULL;
    evas_gl_common_context_free(gw->gl_context);
-   glXDestroyContext(gw->disp, gw->context);
+//   glXDestroyContext(gw->disp, gw->context);
    free(gw);
 }
 




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to