Function:ss2qsa

From S2PLOT

(Difference between revisions)
Jump to: navigation, search
Revision as of 02:48, 23 November 2007
S2plot admin (Talk | contribs)

← Previous diff
Revision as of 03:00, 23 November 2007
S2plot admin (Talk | contribs)

Next diff →
Line 1: Line 1:
-==ss2qas==+==ss2qsa==
-Query the autospin state.+ 
==Prototype== ==Prototype==
<code><pre> <code><pre>
-int ss2qas(void);+void ss2qsa(int *stereo, int *fullscreen, int *dome);</pre></code>
-</pre></code>+
==Description== ==Description==
-Query the autospin state. +Query the "screen" type, including stereo setting, fullscreen and dome status/type. The following return values are possible (see also s2const.h):
 + 
 +Stereo types
 +* NOSTEREO
 +* ACTIVESTEREO
 +* DUALSTEREO
 +* ANAGLYPHSTEREO
 +* TRIOSTEREO
 +* INTERSTEREO
 + 
 +Dome types
 +* NODOME 0
 +* TRUNCBOTTOM 1
 +* TRUNCTOP 2
 +* VSPHERICAL 3
 +* HSPHERICAL 4
 + 
 +The fullscreen=0 if mode is not fullscreen, fullscreen=1 otherwise.
== See Also == == See Also ==
Line 22: Line 38:
#include "s2plot.h" #include "s2plot.h"
-void cb(double *t, int *kc)+ 
 +int main(int argc, char *argv[])
{ {
- static int lkc = 0; /* Count of key presses */+ fprintf(stderr,"Choose a screen mode by entering ?\n");
- ss2sss(50.0); /* Fast spinning! */+ s2opend("/?", argc, argv); /* Prompt for user selection */
- if (lkc != *kc) { /* Space bar pressed? */+ s2swin(-1.,1., -1.,1., -1.,1.); /* Set the window coordinates */
- if (drand48() > 0.5) ss2sas(1); /* Random auto spin state */+ s2box("BCDET",0,0,"BCDET",0,0,"BCDET",0,0); /* Draw coordinate box */
- else ss2sas(0);+
- }+
- float qas = ss2qas(); /* Query autospin state */+ int stereo;
- char string[32];+ int fullscreen;
 + int dome;
 + ss2qsa(&stereo, &fullscreen, &dome);
- if (qas == 0) + fprintf(stderr,"You choose an S2PLOT screen with:\n");
- sprintf(string,"Not spinning"); /* Write to string */+ if (stereo == NOSTEREO) fprintf(stderr,"\tNo stereo support\n");
- else+ else fprintf(stderr,"\tA stereo mode \n");
- sprintf(string,"Whee...."); /* Write to string */+
- s2textxy(0,0,0,string); /* Display text */+ if (fullscreen == 1) fprintf(stderr,"\tFull screen\n");
 + else fprintf(stderr,"\tNot fullscreen\n");
- lkc = *kc; /* Update count */+ if (dome == NODOME) fprintf(stderr,"\tNo dome support\n");
-}+ else fprintf(stderr,"\tA dome mode\n");
-int main(int argc, char *argv[]) 
-{ 
- 
- fprintf(stderr,"Press <spacebar> to randomly change autospin state \n");  
- s2opend("/s2mono",argc, argv); /* Open the display: mono */ 
- s2swin(-1.,1., -1.,1., -1.,1.); /* Set the window coordinates */ 
- 
- cs2scb(cb); /* Install dynamic callback */ 
- s2show(1); /* Open the s2plot window */ 
-  
return 1; return 1;
} }

Revision as of 03:00, 23 November 2007

ss2qsa

Prototype

void ss2qsa(int *stereo, int *fullscreen, int *dome);

Description

Query the "screen" type, including stereo setting, fullscreen and dome status/type. The following return values are possible (see also s2const.h):

Stereo types

  • NOSTEREO
  • ACTIVESTEREO
  • DUALSTEREO
  • ANAGLYPHSTEREO
  • TRIOSTEREO
  • INTERSTEREO

Dome types

  • NODOME 0
  • TRUNCBOTTOM 1
  • TRUNCTOP 2
  • VSPHERICAL 3
  • HSPHERICAL 4

The fullscreen=0 if mode is not fullscreen, fullscreen=1 otherwise.

See Also

ss2sasStart/Stop the camera rotation..

Code Example

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


int main(int argc, char *argv[])
{
   fprintf(stderr,"Choose a screen mode by entering ?\n");

   s2opend("/?", argc, argv);                   /* Prompt for user selection */
   s2swin(-1.,1., -1.,1., -1.,1.);              /* Set the window coordinates */
   s2box("BCDET",0,0,"BCDET",0,0,"BCDET",0,0);  /* Draw coordinate box */

   int stereo;
   int fullscreen;
   int dome;
   ss2qsa(&stereo, &fullscreen, &dome);

   fprintf(stderr,"You choose an S2PLOT screen with:\n");
   if (stereo == NOSTEREO) fprintf(stderr,"\tNo stereo support\n");
   else fprintf(stderr,"\tA stereo mode \n");

   if (fullscreen == 1) fprintf(stderr,"\tFull screen\n");
   else fprintf(stderr,"\tNot fullscreen\n");

   if (dome == NODOME) fprintf(stderr,"\tNo dome support\n");
   else fprintf(stderr,"\tA dome mode\n");


   return 1;
}

Back to S2PLOT function list.


Personal tools