home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / vos2-121.zip / v / include2 / GL / glaux.h < prev    next >
C/C++ Source or Header  |  1998-11-06  |  9KB  |  336 lines

  1. /* @(#)52    1.2  R2/OPENGL/test/aux/aux.h, gltest, r5gos325, 9334325c 8/25/93 22:37:34 */
  2. /*
  3.  *   COMPONENT_NAME: GLTEST
  4.  *
  5.  *   FUNCTIONS: AUX_SETCOLOR
  6.  *        AUX_WIND_HAS_ACCUM
  7.  *        AUX_WIND_HAS_ALPHA
  8.  *        AUX_WIND_HAS_DEPTH
  9.  *        AUX_WIND_HAS_STENCIL
  10.  *        AUX_WIND_IS_DIRECT
  11.  *        AUX_WIND_IS_DOUBLE
  12.  *        AUX_WIND_IS_INDEX
  13.  *        AUX_WIND_IS_INDIRECT
  14.  *        AUX_WIND_IS_RGB
  15.  *        AUX_WIND_IS_SINGLE
  16.  *        auxExposeFunc
  17.  *        auxIdleFunc
  18.  *        auxKeyFunc
  19.  *        auxMainLoop
  20.  *        auxMouseFunc
  21.  *        auxReshapeFunc
  22.  *        
  23.  *
  24.  *   ORIGINS: 21,27
  25.  *
  26.  *
  27.  *   (C) COPYRIGHT International Business Machines Corp. 1993
  28.  *   All Rights Reserved
  29.  *   Licensed Materials - Property of IBM
  30.  *   US Government Users Restricted Rights - Use, duplication or
  31.  *   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  32.  */
  33.  
  34. /*
  35.  * (c) Copyright 1993, Silicon Graphics, Inc.
  36.  * ALL RIGHTS RESERVED 
  37.  * Permission to use, copy, modify, and distribute this software for 
  38.  * any purpose and without fee is hereby granted, provided that the above
  39.  * copyright notice appear in all copies and that both the copyright notice
  40.  * and this permission notice appear in supporting documentation, and that 
  41.  * the name of Silicon Graphics, Inc. not be used in advertising
  42.  * or publicity pertaining to distribution of the software without specific,
  43.  * written prior permission. 
  44.  *
  45.  * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
  46.  * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
  47.  * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
  48.  * FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL SILICON
  49.  * GRAPHICS, INC.  BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
  50.  * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
  51.  * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
  52.  * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
  53.  * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC.  HAS BEEN
  54.  * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
  55.  * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
  56.  * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
  57.  * 
  58.  * US Government Users Restricted Rights 
  59.  * Use, duplication, or disclosure by the Government is subject to
  60.  * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
  61.  * (c)(1)(ii) of the Rights in Technical Data and Computer Software
  62.  * clause at DFARS 252.227-7013 and/or in similar or successor
  63.  * clauses in the FAR or the DOD or NASA FAR Supplement.
  64.  * Unpublished-- rights reserved under the copyright laws of the
  65.  * United States.  Contractor/manufacturer is Silicon Graphics,
  66.  * Inc., 2011 N.  Shoreline Blvd., Mountain View, CA 94039-7311.
  67.  *
  68.  * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
  69.  */
  70. #ifndef __aux_h__
  71. #define __aux_h__
  72.  
  73. #include <GL/pgl.h>
  74. #include <GL/gl.h>
  75. #include <GL/glu.h>
  76.  
  77. /*
  78. ** ToolKit Window Types
  79. ** In the future, AUX_RGBA may be a combination of both RGB and ALPHA
  80. */
  81.  
  82. #define AUX_RGB        0
  83. #define AUX_RGBA    AUX_RGB
  84. #define AUX_INDEX    1
  85. #define AUX_SINGLE    0
  86. #define AUX_DOUBLE    2
  87. #define AUX_DIRECT    0
  88. #define AUX_INDIRECT    4
  89.  
  90. #define AUX_ACCUM    8
  91. #define AUX_ALPHA    16
  92. #define AUX_DEPTH    32
  93. #define AUX_STENCIL    64
  94. #define AUX_AUX        128
  95.  
  96. /* 
  97. ** Window Masks
  98. */
  99.  
  100. #define AUX_WIND_IS_RGB(x)    (((x) & AUX_INDEX) == 0)
  101. #define AUX_WIND_IS_INDEX(x)    (((x) & AUX_INDEX) != 0)
  102. #define AUX_WIND_IS_SINGLE(x)    (((x) & AUX_DOUBLE) == 0)
  103. #define AUX_WIND_IS_DOUBLE(x)    (((x) & AUX_DOUBLE) != 0)
  104. #define AUX_WIND_IS_INDIRECT(x)    (((x) & AUX_INDIRECT) != 0)
  105. #define AUX_WIND_IS_DIRECT(x)    (((x) & AUX_INDIRECT) == 0)
  106. #define AUX_WIND_HAS_ACCUM(x)    (((x) & AUX_ACCUM) != 0)
  107. #define AUX_WIND_HAS_ALPHA(x)    (((x) & AUX_ALPHA) != 0)
  108. #define AUX_WIND_HAS_DEPTH(x)    (((x) & AUX_DEPTH) != 0)
  109. #define AUX_WIND_HAS_STENCIL(x)    (((x) & AUX_STENCIL) != 0)
  110.  
  111. /*
  112. ** ToolKit Event Structure
  113. */
  114.  
  115. typedef struct _AUX_EVENTREC {
  116.     GLint event;
  117.     GLint data[4];
  118. } AUX_EVENTREC;
  119.  
  120. /* 
  121. ** ToolKit Event Types
  122. */
  123. #define AUX_EXPOSE    1
  124. #define AUX_CONFIG    2
  125. #define AUX_DRAW    4
  126. #define AUX_KEYEVENT    8
  127. #define AUX_MOUSEDOWN    16
  128. #define AUX_MOUSEUP    32    
  129. #define AUX_MOUSELOC    64
  130.  
  131. /*
  132. ** Toolkit Event Data Indices
  133. */
  134. #define AUX_WINDOWX        0
  135. #define AUX_WINDOWY        1
  136. #define AUX_MOUSEX        0
  137. #define AUX_MOUSEY        1
  138. #define AUX_MOUSESTATUS        3
  139. #define AUX_KEY            0
  140. #define AUX_KEYSTATUS        1
  141.  
  142. /*
  143. ** ToolKit Event Status Messages
  144. */
  145. #define    AUX_LEFTBUTTON        1
  146. #define    AUX_RIGHTBUTTON        2
  147. #define    AUX_MIDDLEBUTTON    4
  148. #define    AUX_SHIFT        1
  149. #define    AUX_CONTROL        2
  150.  
  151. /* 
  152. ** ToolKit Key Codes
  153. */
  154.  
  155.  
  156.  
  157. #define AUX_RETURN        0x0D
  158. #define AUX_ESCAPE        0x1B
  159. #define AUX_SPACE        0x20
  160. #define AUX_LEFT        0x25
  161. #define AUX_UP            0x26
  162. #define AUX_RIGHT        0x27
  163. #define AUX_DOWN        0x28
  164. #define AUX_A            'A'
  165. #define AUX_B            'B'
  166. #define AUX_C            'C'
  167. #define AUX_D            'D'
  168. #define AUX_E            'E'
  169. #define AUX_F            'F'
  170. #define AUX_G            'G'
  171. #define AUX_H            'H'
  172. #define AUX_I            'I'
  173. #define AUX_J            'J'
  174. #define AUX_K            'K'
  175. #define AUX_L            'L'
  176. #define AUX_M            'M'
  177. #define AUX_N            'N'
  178. #define AUX_O            'O'
  179. #define AUX_P            'P'
  180. #define AUX_Q            'Q'
  181. #define AUX_R            'R'
  182. #define AUX_S            'S'
  183. #define AUX_T            'T'
  184. #define AUX_U            'U'
  185. #define AUX_V            'V'
  186. #define AUX_W            'W'
  187. #define AUX_X            'X'
  188. #define AUX_Y            'Y'
  189. #define AUX_Z            'Z'
  190. #define AUX_a            'a'
  191. #define AUX_b            'b'
  192. #define AUX_c            'c'
  193. #define AUX_d            'd'
  194. #define AUX_e            'e'
  195. #define AUX_f            'f'
  196. #define AUX_g            'g'
  197. #define AUX_h            'h'
  198. #define AUX_i            'i'
  199. #define AUX_j            'j'
  200. #define AUX_k            'k'
  201. #define AUX_l            'l'
  202. #define AUX_m            'm'
  203. #define AUX_n            'n'
  204. #define AUX_o            'o'
  205. #define AUX_p            'p'
  206. #define AUX_q            'q'
  207. #define AUX_r            'r'
  208. #define AUX_s            's'
  209. #define AUX_t            't'
  210. #define AUX_u            'u'
  211. #define AUX_v            'v'
  212. #define AUX_w            'w'
  213. #define AUX_x            'x'
  214. #define AUX_y            'y'
  215. #define AUX_z            'z'
  216. #define AUX_0            '0'
  217. #define AUX_1            '1'
  218. #define AUX_2            '2'
  219. #define AUX_3            '3'
  220. #define AUX_4            '4'
  221. #define AUX_5            '5'
  222. #define AUX_6            '6'
  223. #define AUX_7            '7'
  224. #define AUX_8            '8'
  225. #define AUX_9            '9'
  226.  
  227. /*
  228. ** ToolKit Gets and Sets
  229. */
  230. #define AUX_FD            1  /* return fd (long) */
  231. #define AUX_COLORMAP        3  /* pass buf of r, g and b (unsigned char) */
  232. #define AUX_GREYSCALEMAP    4
  233. #define AUX_FOGMAP        5  /* pass fog and color bits (long) */
  234. #define AUX_ONECOLOR        6  /* pass index, r, g, and b (long) */
  235.  
  236. /*
  237. ** Color Macros
  238. */
  239.  
  240. enum {
  241.     AUX_BLACK = 0,
  242.     AUX_RED,
  243.     AUX_GREEN,
  244.     AUX_YELLOW,
  245.     AUX_BLUE,
  246.     AUX_MAGENTA,
  247.     AUX_CYAN,
  248.     AUX_WHITE
  249. };
  250.  
  251. extern float auxRGBMap[8][3];
  252.  
  253. #define AUX_SETCOLOR(x, y) (AUX_WIND_IS_RGB((x)) ? \
  254.                    glColor3fv(auxRGBMap[(y)]) : glIndexf((y)))
  255.  
  256. /*
  257. ** RGB Image Structure
  258. */
  259.  
  260. typedef struct _AUX_RGBImageRec {
  261.     GLint sizeX, sizeY;
  262.     unsigned char *data;
  263. } AUX_RGBImageRec;
  264.  
  265. /*
  266. ** Prototypes
  267. */
  268.  
  269. extern void APIENTRY auxInitDisplayMode(GLenum);
  270. extern void APIENTRY auxInitPosition(int, int, int, int);
  271. extern GLenum APIENTRY auxInitWindow(char *);
  272. extern void APIENTRY auxCloseWindow(void);
  273. extern void APIENTRY auxQuit(void);
  274. extern void APIENTRY auxClipBoard(void);
  275. extern void APIENTRY auxSwapBuffers(void);
  276.  
  277. /* No Way in PM maybe auxPMhab() and auxPMWindow
  278. extern Display *auxXDisplay(GLvoid);
  279. extern Window APIENTRY auxXWindow(GLvoid);
  280. */
  281.  
  282. extern void APIENTRY auxMainLoop(void (* APIENTRY)());
  283. extern void APIENTRY auxExposeFunc(void (* APIENTRY)(GLsizei, GLsizei));
  284. extern void APIENTRY auxReshapeFunc(void (* APIENTRY)(GLsizei, GLsizei));
  285. extern void APIENTRY auxIdleFunc(void (* APIENTRY)());
  286. extern void APIENTRY auxKeyFunc(int, void (* APIENTRY)());
  287. extern void APIENTRY auxKeyDownFunc(GLenum (* APIENTRY)(int, GLenum));
  288. extern void APIENTRY auxMouseFunc(int, int, void (* APIENTRY)(AUX_EVENTREC *));
  289. extern void APIENTRY auxMouseDownFunc(GLenum (* APIENTRY)(int, int, GLenum));
  290. extern void APIENTRY auxMouseUpFunc(GLenum (* APIENTRY)(int, int, GLenum));
  291. extern void APIENTRY auxMouseMoveFunc(GLenum (* APIENTRY)(int, int, GLenum));
  292.  
  293. extern GLint APIENTRY auxGetColorMapSize(void);
  294. extern void APIENTRY auxGetMouseLoc(int *, int *);
  295. extern void APIENTRY auxSetOneColor(int, float, float, float);
  296. extern void APIENTRY auxSetFogRamp(int, int);
  297. extern void APIENTRY auxSetGreyRamp(void);
  298. extern void APIENTRY auxSetRGBMap(int, float *);
  299.  
  300. extern AUX_RGBImageRec * APIENTRY auxRGBImageLoad(char *);
  301.  
  302. extern void APIENTRY auxCreateFont(void);
  303. extern void APIENTRY auxDrawStr(char *);
  304.  
  305. extern void APIENTRY auxWireSphere(GLdouble);
  306. extern void APIENTRY auxSolidSphere(GLdouble);
  307. extern void APIENTRY auxWireCube(GLdouble);
  308. extern void APIENTRY auxSolidCube(GLdouble);
  309. extern void APIENTRY auxWireBox(GLdouble, GLdouble, GLdouble);
  310. extern void APIENTRY auxSolidBox(GLdouble, GLdouble, GLdouble);
  311. extern void APIENTRY auxWireTorus(GLdouble, GLdouble);
  312. extern void APIENTRY auxSolidTorus(GLdouble, GLdouble);
  313. extern void APIENTRY auxWireCylinder(GLdouble, GLdouble);
  314. extern void APIENTRY auxSolidCylinder(GLdouble, GLdouble);
  315. extern void APIENTRY auxWireIcosahedron(GLdouble);
  316. extern void APIENTRY auxSolidIcosahedron(GLdouble);
  317. extern void APIENTRY auxWireOctahedron(GLdouble);
  318. extern void APIENTRY auxSolidOctahedron(GLdouble);
  319. extern void APIENTRY auxWireTetrahedron(GLdouble);
  320. extern void APIENTRY auxSolidTetrahedron(GLdouble);
  321. extern void APIENTRY auxWireDodecahedron(GLdouble);
  322. extern void APIENTRY auxSolidDodecahedron(GLdouble);
  323. extern void APIENTRY auxWireCone(GLdouble, GLdouble);
  324. extern void APIENTRY auxSolidCone(GLdouble, GLdouble);
  325. extern void APIENTRY auxWireTeapot(GLdouble);
  326. extern void APIENTRY auxSolidTeapot(GLdouble);
  327.  
  328.  
  329. enum {
  330.     AUX_USE_ID = 1,
  331.     AUX_EXACT_MATCH,
  332.     AUX_MINIMUM_CRITERIA
  333. };
  334.  
  335. #endif /* __aux_h__ */
  336.