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.2 2006/01/17 02:31:57 bernie
18 *#* Test gfx with the usual pentagons.
20 *#* Revision 1.1 2006/01/16 03:51:35 bernie
21 *#* Add LCD Qt emulator.
25 #include <emul/emul.h>
26 #include <drv/lcd_gfx.h>
29 static void magic(struct Bitmap *bitmap, coord_t x, coord_t y)
31 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 };
34 gfx_moveTo(bitmap, coords[countof(coords)-2]/2 + x, coords[countof(coords)-1]/3 + y);
35 for (i = 0; i < countof(coords); i += 2)
36 gfx_lineTo(bitmap, coords[i]/2 + x, coords[i+1]/3 + y);
39 int main(int argc, char *argv[])
41 emul_init(&argc, argv);
44 coord_t x = 0, y = LCD_WIDTH / 2;
45 coord_t xdir = +1, ydir = -1;
49 gfx_bitmapClear(&lcd_bitmap);
50 gfx_rectDraw(&lcd_bitmap, 10, 10, LCD_WIDTH-10, LCD_HEIGHT-10);
51 gfx_setClipRect(&lcd_bitmap, 10, 10, LCD_WIDTH-10, LCD_HEIGHT-10);
52 magic(&lcd_bitmap, x, y);
56 if (x >= LCD_WIDTH) xdir = -1;
57 if (x <= -50) xdir = +1;
58 if (y >= LCD_HEIGHT) ydir = -1;
59 if (y <= -50) ydir = +1;
61 lcd_blit_bitmap(&lcd_bitmap);