From: Enlightenment C. <no...@cv...> - 2007-03-03 10:05:24
|
Enlightenment CVS committal Author : raster Project : e17 Module : libs/evas Dir : e17/libs/evas/src/modules/engines/gl_x11 Modified Files: evas_engine.c Log Message: just look at the comments to know what this is about. =================================================================== RCS file: /cvs/e/e17/libs/evas/src/modules/engines/gl_x11/evas_engine.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -3 -r1.21 -r1.22 --- evas_engine.c 29 Dec 2006 03:32:46 -0000 1.21 +++ evas_engine.c 3 Mar 2007 16:05:15 -0000 1.22 @@ -194,6 +194,16 @@ // printf("GL: finish update cycle!\n"); } +/* at least the nvidia drivers are so abysmal that copying from the backbuffer + * to the front using glCopyPixels() that you literally can WATCH it draw the + * pixels slowly across the screen with a window update taking multiple + * seconds - so workaround by doing a full buffer render as frankly GL isn't + * up to doing anything that isn't done by quake (etc.) + */ +#define SLOW_GL_COPY_RECT 1 +/* vsync games - not for now though */ +//#define VSYNC_TO_SCREEN 1 + static void * eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, int *cx, int *cy, int *cw, int *ch) { @@ -207,6 +217,24 @@ return NULL; } // printf("GL: update....!\n"); +#ifdef SLOW_GL_COPY_RECT + /* if any update - just return the whole canvas - works with swap + * buffers then */ + if (x) *x = 0; + if (y) *y = 0; + if (w) *w = re->win->w; + if (h) *h = re->win->h; + if (cx) *cx = 0; + if (cy) *cy = 0; + if (cw) *cw = re->win->w; + if (ch) *ch = re->win->h; +#else + /* 1 update - INCREDIBLY SLOW if combined with swap_rect in flush. a gl + * problem where there just is no hardware path for somethnig that + * obviously SHOULD be there */ + /* only 1 update to minimise gl context games and rendering multiple update + * regions as evas does with other engines + */ if (x) *x = re->win->draw.x1; if (y) *y = re->win->draw.y1; if (w) *w = re->win->draw.x2 - re->win->draw.x1 + 1; @@ -215,6 +243,7 @@ if (cy) *cy = re->win->draw.y1; if (cw) *cw = re->win->draw.x2 - re->win->draw.x1 + 1; if (ch) *ch = re->win->draw.y2 - re->win->draw.y1 + 1; +#endif return re; } @@ -238,14 +267,7 @@ // printf("GL: flush your mush!\n"); eng_window_use(re->win); -/* SLOW AS ALL HELL! */ -#if 0 - evas_gl_common_swap_rect(re->win->gl_context, - re->win->draw.x1, re->win->draw.y1, - re->win->draw.x2 - re->win->draw.x1 + 1, - re->win->draw.y2 - re->win->draw.y1 + 1); -#else -#if 0 +#ifdef VSYNC_TO_SCREEN glFlush(); { unsigned int rc; @@ -254,7 +276,14 @@ glXWaitVideoSyncSGI(2, (rc + 1) % 2, &rc); } #endif +#ifdef SLOW_GL_COPY_RECT glXSwapBuffers(re->win->disp, re->win->win); +#else + /* SLOW AS ALL HELL! */ + evas_gl_common_swap_rect(re->win->gl_context, + re->win->draw.x1, re->win->draw.y1, + re->win->draw.x2 - re->win->draw.x1 + 1, + re->win->draw.y2 - re->win->draw.y1 + 1); #endif // glFlush(); // glXWaitGL(); |