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