Main Page   File List   Globals  

tests/test4.c

00001 /***************************************************************************
00002                        test2.c  -  test putpixel speed
00003                              -------------------
00004     begin                : Sat Feb 16 2002
00005     copyright            : (C) 2000 by Daniele Venzano
00006     email                : webvenza@libero.it
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; version 2 of the License.               *
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 }

Generated on Sat Jul 5 09:04:52 2003 for LibFB by doxygen1.2.18