4 * Copyright 2006 Develer S.r.l. (http://www.develer.com/)
5 * This file is part of DevLib - See README.devlib for information.
10 * \author Bernardo Innocenti <bernie@develer.com>
12 * \brief dot-matrix LCD test.
17 *#* Revision 1.3 2006/01/17 23:00:26 bernie
18 *#* Don't use hardcoded coordinates.
20 *#* Revision 1.2 2006/01/17 02:31:57 bernie
21 *#* Test gfx with the usual pentagons.
23 *#* Revision 1.1 2006/01/16 03:51:35 bernie
24 *#* Add LCD Qt emulator.
28 #include <emul/emul.h>
29 #include <drv/lcd_gfx.h>
32 static void magic(struct Bitmap *bitmap, coord_t x, coord_t y)
34 static const coord_t coords[] = { 120, 34, 90, 90, 30, 90, 0, 34, 60, 0, 90, 90, 0, 34, 120, 34, 30, 90, 60, 0 };
37 gfx_moveTo(bitmap, coords[countof(coords)-2]/2 + x, coords[countof(coords)-1]/3 + y);
38 for (i = 0; i < countof(coords); i += 2)
39 gfx_lineTo(bitmap, coords[i]/2 + x, coords[i+1]/3 + y);
42 int main(int argc, char *argv[])
44 emul_init(&argc, argv);
47 coord_t x = 0, y = LCD_WIDTH / 2;
48 coord_t xdir = +1, ydir = -1;
49 Bitmap *bm = &lcd_bitmap;
54 gfx_setClipRect(bm, 0, 0, bm->width, bm->height);
55 gfx_rectDraw(bm, 10, 10, bm->width-10, bm->height-10);
56 gfx_setClipRect(bm, 11, 11, bm->width-11, bm->height-11);
61 if (x >= bm->width) xdir = -1;
62 if (x <= -50) xdir = +1;
63 if (y >= bm->height) ydir = -1;
64 if (y <= -50) ydir = +1;