00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00034 #include <gdm/display.h>
00035 #include <gdm/display-hw.h>
00036
00037
00038 gdm_display display;
00039
00040 int
00041 main ()
00042 {
00043 unsigned short x = 0;
00044 unsigned short y = 0;
00045 unsigned short w = 31;
00046 unsigned short h = 31;
00047 unsigned short ox = 0;
00048 unsigned short oy = 0;
00049 unsigned short ow = 0;
00050 unsigned short oh = 0;
00051 short lx = 0;
00052 short ly = 0;
00053 unsigned short olx = 0;
00054 unsigned short oly = 0;
00055 short dx = 1;
00056 short dy = 0;
00057
00058
00059
00060 gdm_initialize (&display);
00061
00062
00063 gdm_set_gc (&display, GDM_PLOT_XOR);
00064 while (1)
00065 {
00066 if (ow)
00067 {
00068 gdm_fill_rectangle (&display, ox, oy, ow, oh);
00069 gdm_draw_circle (&display, ox, oy, 30);
00070 gdm_draw_line (&display, 64, 32, olx, oly);
00071 }
00072 gdm_fill_rectangle (&display, x, y, w, h);
00073 gdm_draw_circle (&display, x, y, 30);
00074 gdm_draw_line (&display, 64, 32, lx, ly);
00075 ox = x;
00076 oy = y;
00077 ow = w;
00078 oh = h;
00079 olx = lx;
00080 oly = ly;
00081 x++;
00082 if (x >= 128) {
00083 x = 0;
00084 y++;
00085 if (y > 64)
00086 y = 0;
00087 }
00088
00089 lx += dx;
00090 if (lx >= 128)
00091 {
00092 lx = 127;
00093 dx = 0;
00094 dy = 1;
00095 }
00096 else if (lx < 0)
00097 {
00098 lx = 0;
00099 dx = 0;
00100 dy = -1;
00101 }
00102 ly += dy;
00103 if (ly >= 64)
00104 {
00105 ly = 63;
00106 dy = 0;
00107 dx = -1;
00108 }
00109 else if (ly < 0)
00110 {
00111 ly = 0;
00112 dy = 0;
00113 dx = 1;
00114 }
00115
00116
00117 gdm_refresh (&display);
00118 }
00119 }