Function:s2disp

From S2PLOT

Jump to: navigation, search

s2disp

Draw the scene, but return control when a timeout occurs or when shift-ENTER is pressed.

Prototype

void s2disp(int idelay, int irestorecamera);

Description

Draw the scene, but return control when a timeout occurs or when the user hits the key combination: shift-ENTER. In some distributions, this capability is not available - a warning will be issued and s2show will be called implicitly.

  • If idelay = 0, the function returns immediately the event buffer is clear.
  • If idelay > 0 the function will return after this many seconds or when key is pressed.
  • If idelay < 0 there is no timeout, and the function returns when shift-ENTER is pressed.
  • If irestorecamera > 0, the camera will be returned to its "home" position, otherwise it is left in the current position.


See Also

s2show Draw the scene and enter interactive mode if interactive is non-zero.


Code Example

#include <stdio.h>
#include <stdlib.h>
#include "s2plot.h"

int main(int argc, char *argv[])
{
   int idelay   = 60;				/* Wait for 60 seconds */
   int irestore = 1;				/* Restore camera to home */

   s2opend("/?",argc, argv);			/* Open the display */
   s2swin(-1.,1., -1.,1., -1.,1.);		/* Set the window coordinates */
   s2box("BCDET",0,0,"BCDET",0,0,"BCDET",0,0);	/* Draw coordinate box */
   s2disp(idelay, irestore);			/* Open the s2plot window */
   
   return 1;
}

Back to S2PLOT function list.


Personal tools