--- ray/src/hd/rhdriver.h 1997/11/21 15:11:43 3.3 +++ ray/src/hd/rhdriver.h 1997/12/14 09:45:48 3.10 @@ -15,14 +15,31 @@ extern struct driver { int ifd; /* input file descriptor (for select) */ } odev; /* our open device */ - /* dev_input() return flags */ -#define DEV_SHUTDOWN 01 /* user shutdown request */ -#define DEV_NEWVIEW 02 /* view change (new view in odev.v) */ -#define DEV_NEWSIZE 04 /* device resolution change */ -#define DEV_WAIT 010 /* pause computation and wait for input */ -#define DEV_RESUME 020 /* resume after pause */ + /* user commands */ +#define DC_SETVIEW 0 /* set the view */ +#define DC_GETVIEW 1 /* print the current 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_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('L'),'K','R','C','q'} + /* commands entered on stdin */ +#define DC_INIT {"VIEW=","where","last","pause","resume","redraw",\ + "kill","restart","clobber","quit"} + + /************************************************************************ * Driver routines (all are required): @@ -36,19 +53,23 @@ The view type, horizontal and vertical view angles and parameters in odev.v should also be assigned. -void +int dev_view(nv) : set display view parameters VIEW *nv; : the new view Updates the display for the given view change. Look for nv==&odev.v when making view current after dev_input() -returns DEV_NEWVIEW flag. +returns DEV_NEWVIEW flag. Return 1 on success, or 0 if the +new view would conflict with device requirements. In the latter +case, reset parameters in nv to make it more agreeable, calling +error(COMMAND, "appropriate user warning"). void -dev_value(c, p) : register new point of light +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. @@ -65,7 +86,7 @@ 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 DEV_NEWVIEW or DEV_NEWSIZE flag is returned, the odev +If the DC_VIEW or DC_RESIZE flag is returned, the odev structure must be updated beforehand.