home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
gondwana.ecr.mu.oz.au/pub/
/
Graphics.tar
/
Graphics
/
fermiVogle.tar.Z
/
fermiVogle.tar
/
devel
/
src
/
rect.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-02-07
|
1KB
|
70 lines
#include "vogle.h"
/*
* rect
*
* draw a rectangle given two opposite corners
*
*/
void
rect(float x1, float y1, float x2, float y2)
{
int sync, flag = 0;
if (!vdevice.initialised)
verror("rect: vogle not initialised");
if ((vdevice.attr->a.fill || vdevice.attr->a.hatch) && !vdevice.inpolygon) {
flag = 1;
makepoly(); /* want it filled */
}
if ((sync = vdevice.sync))
vdevice.sync = 0;
move2(x1, y1);
draw2(x2, y1);
draw2(x2, y2);
draw2(x1, y2);
if (flag)
closepoly();
else
draw2(x1, y1);
if (sync) {
vdevice.sync = 1;
(*vdevice.dev.Vsync)();
}
}
/*
* srect
*
* draw a rectangle given two opposite corners in screen coords.
*
*/
void
srect(float x1, float y1, float x2, float y2)
{
int sync;
if (!vdevice.initialised)
verror("rect: vogle not initialised");
if ((sync = vdevice.sync))
vdevice.sync = 0;
smove2(x1, y1);
sdraw2(x2, y1);
sdraw2(x2, y2);
sdraw2(x1, y2);
sdraw2(x1, y1);
if (sync) {
vdevice.sync = 1;
(*vdevice.dev.Vsync)();
}
}