home *** CD-ROM | disk | FTP | other *** search
/ The Best of Windows 95.com 1996 September / WIN95_09963.iso / filelib / OGLFIX.EXE / GLAUX.H < prev    next >
C/C++ Source or Header  |  1995-04-17  |  12KB  |  373 lines

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