home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Developer CD v1.2
/
amidev_cd_12.iso
/
devcon
/
milan_1991
/
devcon91.2
/
tiga
/
demos
/
boxes.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-09-01
|
1KB
|
48 lines
#include <stdio.h>
#include <a2410/typedefs.h>
#include <a2410/devtiga.h>
#include <clib/a2410_protos.h>
#include <math.h>
BOOL TIGA_Init(void);
void TIGA_Close(void);
void TIGA_Break(void);
void TIGA_SetRandPalet(void);
void BoxDemo(void);
/* ================================================================================ */
void main(int argc, char **argv)
{
if (TIGA_Init())
{
onbreak(TIGA_Break);
TIGA_SetRandPalet();
BoxDemo();
TIGA_Close();
}
}
/* ------------------------------------------------------------------------------- */
void BoxDemo()
{
int x,y,w,h,i;
CONFIG config;
get_config(&config);
for (;;)
{
chkabort();
w = rand() % (config.mode.disp_hres-1)+1;
h = rand() % (config.mode.disp_vres-1)+1;
x = rand() % (config.mode.disp_hres-w);
y = rand() % (config.mode.disp_vres-h);
i = rand() % config.mode.palet_size;
set_fcolor(i);
fill_rect(w, h, x, y);
}
}
/* ------------------------------------------------------------------------------- */