SVN revision: 2971
This commit is contained in:
Carsten Haitzler 2000-08-02 04:23:04 +00:00
parent 5631d58659
commit 855ccdc507
4 changed files with 69 additions and 3 deletions

View File

@ -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)
{

View File

@ -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);

View File

@ -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

View File

@ -1,6 +1,65 @@
#include <Evas.h>
#include "../src/evas_gl_routines.h"
#include <math.h>
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;
}
}
}