From 855ccdc507140175ca172442e0ba04c3b68031fd Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Wed, 2 Aug 2000 04:23:04 +0000 Subject: [PATCH] balh1 SVN revision: 2971 --- legacy/evas/src/evas_gl_routines.c | 10 ++++- legacy/evas/src/evas_gl_routines.h | 1 + legacy/evas/test/Makefile.am | 2 +- legacy/evas/test/evas_test.c | 59 ++++++++++++++++++++++++++++++ 4 files changed, 69 insertions(+), 3 deletions(-) diff --git a/legacy/evas/src/evas_gl_routines.c b/legacy/evas/src/evas_gl_routines.c index 76e3b8f0c2..20cc4e6323 100644 --- a/legacy/evas/src/evas_gl_routines.c +++ b/legacy/evas/src/evas_gl_routines.c @@ -244,8 +244,7 @@ void __evas_gl_render_to_window(Evas_GL_Image *im, glEnd(); } } - glXSwapBuffers(im->buffer.display, w); - glDisable(GL_SCISSOR_TEST); +/* glDisable(GL_SCISSOR_TEST);*/ } Evas_GL_Image * @@ -281,6 +280,13 @@ __evas_gl_get_visual(Display *disp) return __evas_vi->visual; } +XVisualInfo * +__evas_gl_get_visual_info(Display *disp) +{ + __evas_gl_get_visual(disp); + return __evas_vi; +} + Colormap __evas_gl_get_colormap(Display *disp) { diff --git a/legacy/evas/src/evas_gl_routines.h b/legacy/evas/src/evas_gl_routines.h index 7401b944e1..a34cdfad69 100644 --- a/legacy/evas/src/evas_gl_routines.h +++ b/legacy/evas/src/evas_gl_routines.h @@ -64,6 +64,7 @@ void __evas_gl_render_to_window(Evas_GL_Image *im, Evas_GL_Image * __evas_gl_create_image(void); int __evas_gl_capable(Display *disp); Visual * __evas_gl_get_visual(Display *disp); +XVisualInfo *__evas_gl_get_visual_info(Display *disp); Colormap __evas_gl_get_colormap(Display *disp); void __evas_gl_init(Display *disp); Evas_GL_Image * __evas_gl_image_new_from_file(Display *disp, char *file); diff --git a/legacy/evas/test/Makefile.am b/legacy/evas/test/Makefile.am index 25e1fd3774..917ef23150 100644 --- a/legacy/evas/test/Makefile.am +++ b/legacy/evas/test/Makefile.am @@ -9,4 +9,4 @@ evas_test_SOURCES = evas_test.c evas_test_LDFLAGS = -static -evas_test_LDADD = $(top_builddir)/src/libevas.la -lImlib2 -lttf -lX11 -lXext -ldl +evas_test_LDADD = $(top_builddir)/src/libevas.la -lImlib2 -lttf -lX11 -lXext -ldl -ldb -lGL -lm diff --git a/legacy/evas/test/evas_test.c b/legacy/evas/test/evas_test.c index 251a89aa37..7f8a86a3d3 100644 --- a/legacy/evas/test/evas_test.c +++ b/legacy/evas/test/evas_test.c @@ -1,6 +1,65 @@ #include +#include "../src/evas_gl_routines.h" +#include int main(int argc, char **argv) { + Display *d; + Visual *vis; + Colormap cmap; + Window win; + + d = XOpenDisplay(NULL); + __evas_gl_init(d); + vis = __evas_gl_get_visual(d); + cmap = __evas_gl_get_colormap(d); + + { + XSetWindowAttributes att; + + att.colormap = cmap; + att.border_pixel = 0; + att.event_mask = 0; + + win = XCreateWindow(d, + RootWindow(d, DefaultScreen(d)), + 0, 0, 800, 600, 0, + (__evas_gl_get_visual_info(d))->depth, + InputOutput, + vis, + CWColormap | CWBorderPixel | CWEventMask, + &att); + XMapWindow(d, win); + } + { + double a = 0.0; + Evas_GL_Image *i, *bg; + + bg = __evas_gl_image_new_from_file(d, "/usr/share/pixmaps/backgrounds/Propaganda/Vol6/8a.jpg"); + i = __evas_gl_image_new_from_file(d, "/usr/share/pixmaps/gnome-gmush.png"); + for(;;) + { + int x, y, j; + + for (y = 0; y < 600; y += bg->h) + { + for (x = 0; x < 800; x += bg->w) + __evas_gl_render_to_window(bg, d, win, 800, 600, + 0, 0, bg->w, bg->h, + x, y, bg->w, bg->h); + } + for (j = 0; j < 32; j++) + { + x = 400 + (cos((a + ((double)j / 10))) * (1 * a)); + y = 300 + (sin((a + ((double)j / 10))) * (1 * a)); + __evas_gl_render_to_window(i, d, win, 800, 600, + 0, 0, i->w, i->h, + x, y, i->w, i->h); + } +/* __evas_sync(d);*/ + __evas_flush_draw(d, win); + a += 0.1; + } + } }