efl/legacy/evas/test/evas_test.c

76 lines
1.8 KiB
C
Raw Normal View History

2000-07-30 13:21:14 -07:00
#include <Evas.h>
2000-08-01 21:23:04 -07:00
#include "../src/evas_gl_routines.h"
#include <math.h>
2000-07-30 13:21:14 -07:00
int
main(int argc, char **argv)
{
2000-08-01 21:23:04 -07:00
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);
}
{
2000-08-01 22:55:17 -07:00
int a = 0;
Evas_GL_Image *i[4], *bg, *l;
2000-08-01 21:23:04 -07:00
2000-08-01 22:55:17 -07:00
bg = __evas_gl_image_new_from_file(d, "img/sky001.png");
i[0] = __evas_gl_image_new_from_file(d, "img/fog1001.png");
i[1] = __evas_gl_image_new_from_file(d, "img/fog2001.png");
i[2] = __evas_gl_image_new_from_file(d, "img/fog3001.png");
i[3] = __evas_gl_image_new_from_file(d, "img/fog4001.png");
l = __evas_gl_image_new_from_file(d, "img/logo001.png");
2000-08-01 21:23:04 -07:00
for(;;)
{
2000-08-01 22:55:17 -07:00
int x, y, j, k;
2000-08-01 21:23:04 -07:00
2000-08-01 22:55:17 -07:00
__evas_gl_render_to_window(bg, d, win, 800, 600,
0, 0, bg->w, bg->h,
0, 0, 800, 600);
for (k = 0; k < 6; k++)
2000-08-01 21:23:04 -07:00
{
2000-08-01 22:55:17 -07:00
int xx, yy;
j = k % 4;
xx = (((k + 1) * a) / 2) % 800;
yy = 0;
if (k == 0)
__evas_gl_render_to_window(l, d, win, 800, 600,
0, 0, l->w, l->h,
(800 - l->w) / 2, (600 - l->h) /2, l->w, l->h);
__evas_gl_render_to_window(i[j], d, win, 800, 600,
0, 0, i[j]->w, i[j]->h,
xx, yy, 800, 600);
__evas_gl_render_to_window(i[j], d, win, 800, 600,
0, 0, i[j]->w, i[j]->h,
xx - 800, yy, 800, 600);
2000-08-01 21:23:04 -07:00
}
__evas_flush_draw(d, win);
a++;
2000-08-01 22:55:17 -07:00
if (a == (800 * 4)) a = 0;
2000-08-01 21:23:04 -07:00
}
}
2000-07-30 13:21:14 -07:00
}