#include #include "window.h" Matrix projection_stack[MAX_PROJECTION_STACK_SIZE]; int projection_stack_level=0; /*************************************************************************** P U S H P R O J E C T I O N S T A C K ***************************************************************************/ void pushProjectionStack(void) /*!*/ { long oldmode; oldmode=getmmode(); /*printf ("oldmode: %ld\n",oldmode);*/ mmode(MPROJECTION); /*printf ("stack level %d\n",projection_stack_level);*/ getmatrix(projection_stack[projection_stack_level]); projection_stack_level++; mmode(oldmode); } /*************************************************************************** P O P P R O J E C T I O N S T A C K ***************************************************************************/ void popProjectionStack(void) /*!*/ { long oldmode; oldmode=getmmode(); /*printf ("oldmode: %ld\n",oldmode);*/ mmode(MPROJECTION); projection_stack_level--; /*printf ("stack level %d\n",projection_stack_level);*/ loadmatrix(projection_stack[projection_stack_level]); mmode(oldmode); } /*************************************************************************** O P E N R G B W I N D O W ***************************************************************************/ long openRGBWindow(short x, short y, short width, short height, char *name) /*!*/ { long winid; prefposition(x,x+width,y,y+height); winid=winopen(name); drawmode(NORMALDRAW); mmode(MVIEWING); RGBmode(); gconfig(); ortho2(-0.5,width-0.5,-0.5,height-0.5); clear(); return winid; } /*************************************************************************** O P E N R G B S W I N D O W ***************************************************************************/ long openRGBSWindow(long parent, short x, short y, short width, short height) /*!*/ { long winid; winid=swinopen(parent); if (winid==-1) puts ("ERROR - opening window"); winposition(x,x+width,y,y+height); drawmode(NORMALDRAW); mmode(MVIEWING); RGBmode(); gconfig(); ortho2(-0.5,width-0.5,-0.5,height-0.5); clear(); return winid; }