Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

373 lines
12 KiB

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