--- ray/src/hd/rhdriver.h 1997/12/11 16:45:59 3.8 +++ ray/src/hd/rhdriver.h 1998/06/17 15:44:07 3.14 @@ -1,4 +1,4 @@ -/* Copyright (c) 1997 Silicon Graphics, Inc. */ +/* Copyright (c) 1998 Silicon Graphics, Inc. */ /* SCCSid "$SunId$ SGI" */ @@ -10,31 +10,38 @@ extern struct driver { char *name; /* holodeck name or title */ - VIEW v; /* preferred view parameters */ - int hres, vres; /* device resolution */ + VIEW v; /* base view parameters */ + int hres, vres; /* base view resolution */ int ifd; /* input file descriptor (for select) */ } odev; /* our open device */ +extern int imm_mode; /* bundles are being delivered immediately */ + +extern double eyesepdist; /* world eye separation distance */ + /* user commands */ -#define DC_SETVIEW 0 /* set the view */ -#define DC_GETVIEW 1 /* print the current view */ +#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_QUIT 6 /* quit the program */ +#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_NCMDS 7 /* number of commands */ +#define DC_NCMDS 10 /* 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('R'),'q'} +#define DV_INIT {'\0','v','l','p','\r',CTRL('L'),'K','R','C','q'} /* commands entered on stdin */ #define DC_INIT {"VIEW=","where","last","pause","resume","redraw",\ - "quit"} + "kill","restart","clobber","quit"} /************************************************************************ @@ -46,15 +53,15 @@ dev_open(nm) : prepare the device char *nm; : appropriate title bar annotation Sets fields of odev structure and prepares the display for i/o. -The view type, horizontal and vertical view angles and other default -parameters in odev.v should also be assigned. +The base view type, horizontal and vertical view angles and other +default parameters in odev.v should also be assigned. int -dev_view(nv) : set display view parameters +dev_view(nv) : set base view parameters VIEW *nv; : the new view -Updates the display for the given view change. +Updates the display for the given base view change. Look for nv==&odev.v when making view current after dev_input() returns DEV_NEWVIEW flag. Return 1 on success, or 0 if the new view would conflict with device requirements. In the latter @@ -63,12 +70,20 @@ error(COMMAND, "appropriate user warning"). void +dev_clear() : clear device memory + +Clear the device memory in preparation for fresh data. Clearing +the screen is optional. + + +void dev_value(c, p, v) : register new point of light COLR c; : pixel color (RGBE) FVECT p; : world intersection point FVECT v; : ray direction vector -Add the given color point to the display output queue. +Add the given color point to the display output queue. If imm_mode is +non-zero, then values are being sent in rapid succession. int @@ -86,7 +101,28 @@ Returns flags indicating actions to take in the contro If the DC_VIEW or DC_RESIZE flag is returned, the odev structure must be updated beforehand. +void +dev_auxcom(cmd, args) : process auxiliary command +char *cmd, *args; : command name and argument string +Execute an auxiliary command (not one of those listed at the head of +this file). The cmd argument points to the command name itself, and +the args argument points to a string with the rest of the input line. +If the command isn't known or there ARE no auxiliary commands, print +an appropriate COMMAND error message and return. + + +VIEW * +dev_auxview(n, hv) : return nth auxiliary view +int n; : auxiliary view number +int hv[2]; : returned horiz. and vert. image resolution + +Return the nth auxiliary view associated with the current base view. +The hv entries are assigned the horizontal and vertical view resolution, +respectively. Function returns NULL if there are no more auxiliary +views. The zeroeth auxiliary view is the base view itself. + + void dev_close() : close the display @@ -95,3 +131,6 @@ Set odev.v.type=0 and odev.hres=odev.vres=0 when done. ************************************************************************/ + + +extern VIEW *dev_auxview();