00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "FBlib.h"
00017 #include <stdio.h>
00018 #include <stdlib.h>
00019 #include <math.h>
00020 #include <time.h>
00021
00022 #define DEGREES M_PI/12
00023 #define LENGTH 100
00024
00025 int main()
00026 {
00027 FB_pixel col;
00028 double deg=0;
00029 int x, xfont, y, yfont, centerx, centery;
00030
00031 FB_initlib("/dev/fb0");
00032 srandom(time(NULL));
00033 FB_getres(&x, &y);
00034 y -= 20;
00035 yfont = y+2;
00036 xfont = 10;
00037 FB_rectfill(0, y, x, y+20, FB_makecol(0,0,0,0));
00038 centerx = x/2;
00039 centery = y/2;
00040 while(deg <= 2*M_PI)
00041 {
00042 col=FB_makecol(random()%255,random()%255,random()%255,random()%255);
00043 FB_line(centerx, centery, centerx+(LENGTH*cos(deg)), centery+(LENGTH*sin(deg)), col);
00044 deg+=DEGREES;
00045 }
00046 getchar();
00047 FB_clear_screen(FB_makecol(0,0,0,0));
00048 FB_exit();
00049 return 0;
00050 }