--- ray/src/hd/rhdriver.h 1998/08/10 18:39:46 3.15 +++ ray/src/hd/rhdriver.h 1999/03/04 10:29:23 3.20 @@ -1,4 +1,4 @@ -/* Copyright (c) 1998 Silicon Graphics, Inc. */ +/* Copyright (c) 1999 Silicon Graphics, Inc. */ /* SCCSid "$SunId$ SGI" */ @@ -13,8 +13,12 @@ extern struct driver { VIEW v; /* base view parameters */ int hres, vres; /* base view resolution */ int ifd; /* input file descriptor (for select) */ + int firstuse; /* non-zero if driver can't recycle samples */ + int inpready; /* number of unprocessed input events */ } odev; /* our open device */ +extern char odev_args[]; /* command arguments, if any */ + extern int imm_mode; /* bundles are being delivered immediately */ extern double eyesepdist; /* world eye separation distance */ @@ -23,25 +27,26 @@ extern double eyesepdist; /* world eye separation dist #define DC_SETVIEW 0 /* set the base view */ #define DC_GETVIEW 1 /* print the current base view */ #define DC_LASTVIEW 2 /* restore previous view */ -#define DC_PAUSE 3 /* pause the current calculation */ -#define DC_RESUME 4 /* resume the calculation */ -#define DC_REDRAW 5 /* redraw from server */ -#define DC_KILL 6 /* kill rtrace process(es) */ -#define DC_RESTART 7 /* restart rtrace process(es) */ -#define DC_CLOBBER 8 /* clobber holodeck file */ -#define DC_QUIT 9 /* quit the program */ +#define DC_FOCUS 3 /* view focus */ +#define DC_PAUSE 4 /* pause the current calculation */ +#define DC_RESUME 5 /* resume the calculation */ +#define DC_REDRAW 6 /* redraw from server */ +#define DC_KILL 7 /* kill rtrace process(es) */ +#define DC_RESTART 8 /* restart rtrace process(es) */ +#define DC_CLOBBER 9 /* clobber holodeck file */ +#define DC_QUIT 10 /* quit the program */ -#define DC_NCMDS 10 /* number of commands */ +#define DC_NCMDS 11 /* number of commands */ /* dev_input() returns flags from above */ #define DFL(dc) (1<<(dc)) #define CTRL(c) ((c)-'@') /* commands entered in display window */ -#define DV_INIT {'\0','v','l','p','\r',CTRL('L'),'K','R','C','q'} +#define DV_INIT {'\0','v','l','f','p','\r',CTRL('L'),'K','R','C','q'} /* commands entered on stdin */ -#define DC_INIT {"VIEW=","where","last","pause","resume","redraw",\ - "kill","restart","clobber","quit"} +#define DC_INIT {"VIEW=","where","last","frame","pause","resume",\ + "redraw","kill","restart","clobber","quit"} /************************************************************************ @@ -91,7 +96,7 @@ int dev_flush() : flush the output and prepare for select call Updates display, taking any pending action required before select(2) call. -Returns non-zero if there is device input available. +Returns non-zero if there is device input available, setting odev.inpready. int @@ -100,7 +105,10 @@ dev_input() : process pending display input Called when odev struct file descriptor shows input is ready. Returns flags indicating actions to take in the control process. If the DC_VIEW or DC_RESIZE flag is returned, the odev -structure must be updated beforehand. +structure must be updated beforehand. If the DC_FOCUS +flag is set, then odev_args contains the frame dimensions. +No events shall remain when this function returns, +and odev.inpready will therefore be 0. void dev_auxcom(cmd, args) : process auxiliary command @@ -125,6 +133,27 @@ views. The zeroeth auxiliary view is the base view it void +dev_section(gf, pf) : add geometry and ports for rendering +char *gf; : geometry file name +char *pf; : portal file name(s) + +Add the given geometry file to the list of geometry to render for +intermediate views if direct geometry rendering is available. The +second argument gives the name(s) of any portal geometry files +associated with this section. Multiple portal file names are separated +by spaces. A single octree file will be given for the geometry, ending +in the ".oct" suffix. Portal files will be given as zero or more +Radiance scene description file names. If no portals are given for +this section, the string may be NULL. The character strings are +guaranteed to be static (or permanently allocated) such that they may +be safely stored as a pointer. The same pointers or file lists may be +(and often are) given repeatedly. If a given geometry file does not +exist, the call should be silently ignored. If gf is NULL, then the +last section has been given, and the display can be updated with the +new information. + + +void dev_close() : close the display Close the display device and free up resources in preparation for exit. @@ -135,3 +164,5 @@ Set odev.v.type=0 and odev.hres=odev.vres=0 when done. extern VIEW *dev_auxview(); + +extern int2 *beam_view();