home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / demos / gpc / globals.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-04-02  |  4.7 KB  |  170 lines

  1. /* $XConsortium: globals.h,v 5.2 91/04/03 10:29:19 rws Exp $ */
  2.  
  3. /*
  4.  */
  5. /*--------------------------------------------------------------------*\
  6. |
  7. |  Copyright (C) 1989,1990, 1991, National Computer Graphics Association
  8. |
  9. |  Permission is granted to any individual or institution to use, copy, or
  10. |  redistribute this software so long as it is not sold for profit, provided
  11. |  this copyright notice is retained.
  12. |
  13. |                         Developed for the
  14. |                National Computer Graphics Association
  15. |                         2722 Merrilee Drive
  16. |                         Fairfax, VA  22031
  17. |                           (703) 698-9600
  18. |
  19. |                                by
  20. |                 SimGraphics Engineering Corporation
  21. |                    1137 Huntington Drive  Unit A
  22. |                      South Pasadena, CA  91030
  23. |                           (213) 255-0900
  24. |---------------------------------------------------------------------
  25. |
  26. | Author        :    SimGraphics Engineering Corportation
  27. |
  28. | File          :    globals.h
  29. | Date          :    Fri Feb  9 10:46:55 PST 1990
  30. | Project       :    PLB
  31. | Description   :    
  32. | Status        :    Version 1.0
  33. |
  34. | Revisions     :    
  35. |
  36. |      12/90            MFC Tektronix, Inc.: PEX-SI PEX5R1 Release.
  37. |
  38. \*--------------------------------------------------------------------*/
  39. #ifndef MAIN_FUNCTION
  40.  
  41. #define VGLOBAL extern
  42. #define GLOBAL_INIT(v)
  43.  
  44. #else
  45.  
  46. #define VGLOBAL 
  47. #define GLOBAL_INIT(v) = v
  48.  
  49. #endif
  50.  
  51. /* ************************************************************ */ 
  52. #define MATRIX_TABLE_SIZE 256
  53. #define MATRIX_STACK_SIZE 64
  54. /* WORKING: This should be dynamically set based on the actual size */
  55. #define VIEW_TABLE_SIZE wk_info.view_size
  56. #define VIEW_TB_SIZE 256
  57.  
  58. VGLOBAL int matrix_stack_depth GLOBAL_INIT(0);
  59. VGLOBAL float matrix_stack[MATRIX_STACK_SIZE][4][4];
  60. VGLOBAL float matrix_table[MATRIX_TABLE_SIZE][4][4];
  61. VGLOBAL float vo_matrix_public[VIEW_TB_SIZE][4][4];
  62. VGLOBAL float vm_matrix_public[VIEW_TB_SIZE][4][4];
  63.  
  64. VGLOBAL BIF_Traverser_state bif_base_state;
  65. VGLOBAL BIF_Traverser_state *traverser_state GLOBAL_INIT(&bif_base_state);
  66. VGLOBAL int base_state_stid;
  67.  
  68. #ifdef EXTERNALNOTE
  69.     /* The following line adds a global variable to hold a bitwise
  70.     encoded record of datafile and hardware exceptions generated during
  71.     the plb run. The defines for the errors are in bifmacro.h along
  72.     with macros for insertion where the exceptions occur. */
  73. #endif
  74. /* global hardware and datafile exception variable. */
  75. VGLOBAL int plb_exception;
  76.  
  77. typedef struct
  78. {
  79.     int    workid;
  80.     int border_stid;
  81.     int base_state_stid;
  82.     int test_stid;
  83.     int nrs_stid;
  84.     int border_vid;
  85.     int base_state_vid;
  86. } Bench_setup;
  87.  
  88. typedef struct
  89. {
  90.         int    phigs_open;
  91.     int    cmap_size;
  92.     int     dcue_size;
  93.     int     light_size;
  94.     int     view_size;
  95.     float    aspect_ratio;
  96.     int color_model;
  97.     int color_mode;
  98.     int buffer_mode;
  99.     int x;
  100.     int y;
  101. } Wk_info;
  102.  
  103.     /* The following globals apply to the timer code. struct timeb is
  104.     declared in sys/timeb.h  */
  105.  
  106. #include <sys/types.h>
  107. #ifdef NOTREQUIRED
  108. #include <sys/timeb.h>
  109.  
  110. VGLOBAL struct timeb StartTime;
  111. VGLOBAL struct timeb StopTime;
  112. VGLOBAL struct timeb LapTime;
  113. #endif /* NOTREQUIRED */
  114.  
  115. #define RESERVED_BASE 21400
  116. #ifdef MAIN_FUNCTION
  117. VGLOBAL Bench_setup bench_setup =
  118. {
  119.     1,            /* Workstation ID        */
  120.     RESERVED_BASE,        /* Display Border Structure    */
  121.     RESERVED_BASE + 1,    /* Base State structure        */
  122.     RESERVED_BASE + 2,    /* Test Loop structure        */
  123.     RESERVED_BASE + 3,    /* "Non-retained" structure    */
  124.      0,
  125.     0
  126. };
  127. VGLOBAL Wk_info wk_info = 
  128. {
  129.         0,            /* Phigs Open State            */
  130.         0,            /* Color Map Size              */
  131.     20,            /* Depth Cue Table Entries     */
  132.     8,            /* Light Table Entries         */
  133.     VIEW_TB_SIZE,        /* View Table Entries           */
  134.     1,            /* Aspect Ratio                */
  135.     0,            /* Color Model                 */
  136.     0,            /* Color Mode                  */
  137.         0,            /* Buffer Mode                 */
  138.     900,720            /* Window Size                 */
  139. };
  140. #else
  141. VGLOBAL Bench_setup bench_setup;
  142. VGLOBAL Wk_info     wk_info;
  143. #endif /* MAIN_FUNCTION */
  144.  
  145. #ifdef USING_PHIGS
  146. VGLOBAL int user_background;
  147. VGLOBAL int Argc;
  148. VGLOBAL char **Argv;
  149.  
  150. #ifdef MAIN_FUNCTION
  151. VGLOBAL XrmOptionDescRec opTable[] = {
  152.     {"-display",    ".display",    XrmoptionSepArg, (caddr_t)NULL},
  153.     {"-geometry",    ".geometry",    XrmoptionSepArg, (caddr_t)NULL},
  154.     {"-bd",        ".borderColor",    XrmoptionSepArg, (caddr_t)NULL},
  155.     {"-bg",        ".background",     XrmoptionSepArg, (caddr_t)NULL},
  156.     {"-bw",        ".borderWidth",    XrmoptionSepArg, (caddr_t)NULL},
  157.     {"-hlhsr",        ".hlhsrMode",    XrmoptionSepArg, (caddr_t)NULL},
  158.     {"-buff",        ".bufferMode",    XrmoptionSepArg, (caddr_t)NULL},
  159. };
  160. #else
  161. VGLOBAL XrmOptionDescRec opTable[];
  162. #endif /* MAIN_FUNCTION */
  163.  
  164. #define NUM_OPTIONS (sizeof(opTable) / sizeof(opTable[0]))
  165. VGLOBAL XrmDatabase gpc_res_db;
  166. #endif /* USING_PHIGS */
  167.  
  168. VGLOBAL char *Prog_name;
  169. VGLOBAL slList nrs_link;
  170.