Rev 306 | Rev 310 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
/*******************************************************************************
* ggitest.c - a simple test of the draw library
*
* Copyright (c) 2006, Ira W. Snyder (devel@irasnyder.com)
******************************************************************************/
#include <stdio.h>
#include <math.h>
#include "draw.h"
int main ()
{
int i;
/* Initialize */
draw_init ();
/* Use */
draw_clearscreen ();
draw_putpixel (20, 20, RED);
draw_box (50, 50, 100, 100, GREEN);
draw_line (30, 20, 300, 180, BLUE);
draw_box (100, 80, 100, 100, WHITE);
sleep (5);
draw_clearscreen ();
for (i=0; i<16; i++)
draw_box ((i+1)*10, (i+1)*10, 10, 10, i);
sleep (5);
/* Slow draw */
draw_clearscreen ();
for (i=0; i<800; i++)
{
draw_putpixel (i, 400+(50.0 * sin(i / 50.0)), GREEN);
usleep (10000);
}
/* text output */
draw_clearscreen ();
draw_putc (0, 0, 'i', RED);
draw_putc (20, 20, 'r', GREEN);
draw_putc (40, 40, 'a', BLUE);
draw_puts (60, 60, "rocks", GREEN);
draw_puts (0, 80, "Hellooooooo world! w00t!", WHITE);
sleep (5);
/* Quit */
draw_close ();
return (0);
}