source: GTP/branches/IllumWPdeliver2008dec/IlluminationWP/demos/Standalone/Hierarchical Systems Demo [OpenGL]/RESOURCES/include/GL/GLAux.h @ 3255

Revision 3255, 11.7 KB checked in by szirmay, 15 years ago (diff)
Line 
1/*++ BUILD Version: 0004    // Increment this if a change has global effects
2
3Copyright (c) 1985-95, Microsoft Corporation
4
5Module Name:
6
7    glaux.h
8
9Abstract:
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
61extern "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_DEPTH24         32      /* 24-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#define AUX_DEPTH           AUX_DEPTH16 /* default is 16-bit depth buffer */
85
86/*
87** Window Masks
88*/
89
90#define AUX_WIND_IS_RGB(x)      (((x) & AUX_INDEX) == 0)
91#define AUX_WIND_IS_INDEX(x)    (((x) & AUX_INDEX) != 0)
92#define AUX_WIND_IS_SINGLE(x)   (((x) & AUX_DOUBLE) == 0)
93#define AUX_WIND_IS_DOUBLE(x)   (((x) & AUX_DOUBLE) != 0)
94#define AUX_WIND_IS_INDIRECT(x) (((x) & AUX_INDIRECT) != 0)
95#define AUX_WIND_IS_DIRECT(x)   (((x) & AUX_INDIRECT) == 0)
96#define AUX_WIND_HAS_ACCUM(x)   (((x) & AUX_ACCUM) != 0)
97#define AUX_WIND_HAS_ALPHA(x)   (((x) & AUX_ALPHA) != 0)
98#define AUX_WIND_HAS_DEPTH(x)   (((x) & (AUX_DEPTH24 | AUX_DEPTH16)) != 0)
99#define AUX_WIND_HAS_STENCIL(x) (((x) & AUX_STENCIL) != 0)
100#define AUX_WIND_USES_FIXED_332_PAL(x)  (((x) & AUX_FIXED_332_PAL) != 0)
101
102/*
103** ToolKit Event Structure
104*/
105
106typedef struct _AUX_EVENTREC {
107    GLint event;
108    GLint data[4];
109} AUX_EVENTREC;
110
111/*
112** ToolKit Event Types
113*/
114#define AUX_EXPOSE      1
115#define AUX_CONFIG      2
116#define AUX_DRAW        4
117#define AUX_KEYEVENT    8
118#define AUX_MOUSEDOWN   16
119#define AUX_MOUSEUP     32
120#define AUX_MOUSELOC    64
121
122/*
123** Toolkit Event Data Indices
124*/
125#define AUX_WINDOWX             0
126#define AUX_WINDOWY             1
127#define AUX_MOUSEX              0
128#define AUX_MOUSEY              1
129#define AUX_MOUSESTATUS         3
130#define AUX_KEY                 0
131#define AUX_KEYSTATUS           1
132
133/*
134** ToolKit Event Status Messages
135*/
136#define AUX_LEFTBUTTON          1
137#define AUX_RIGHTBUTTON         2
138#define AUX_MIDDLEBUTTON        4
139#define AUX_SHIFT               1
140#define AUX_CONTROL             2
141
142/*
143** ToolKit Key Codes
144*/
145#define AUX_RETURN              0x0D
146#define AUX_ESCAPE              0x1B
147#define AUX_SPACE               0x20
148#define AUX_LEFT                0x25
149#define AUX_UP                  0x26
150#define AUX_RIGHT               0x27
151#define AUX_DOWN                0x28
152#define AUX_A                   'A'
153#define AUX_B                   'B'
154#define AUX_C                   'C'
155#define AUX_D                   'D'
156#define AUX_E                   'E'
157#define AUX_F                   'F'
158#define AUX_G                   'G'
159#define AUX_H                   'H'
160#define AUX_I                   'I'
161#define AUX_J                   'J'
162#define AUX_K                   'K'
163#define AUX_L                   'L'
164#define AUX_M                   'M'
165#define AUX_N                   'N'
166#define AUX_O                   'O'
167#define AUX_P                   'P'
168#define AUX_Q                   'Q'
169#define AUX_R                   'R'
170#define AUX_S                   'S'
171#define AUX_T                   'T'
172#define AUX_U                   'U'
173#define AUX_V                   'V'
174#define AUX_W                   'W'
175#define AUX_X                   'X'
176#define AUX_Y                   'Y'
177#define AUX_Z                   'Z'
178#define AUX_a                   'a'
179#define AUX_b                   'b'
180#define AUX_c                   'c'
181#define AUX_d                   'd'
182#define AUX_e                   'e'
183#define AUX_f                   'f'
184#define AUX_g                   'g'
185#define AUX_h                   'h'
186#define AUX_i                   'i'
187#define AUX_j                   'j'
188#define AUX_k                   'k'
189#define AUX_l                   'l'
190#define AUX_m                   'm'
191#define AUX_n                   'n'
192#define AUX_o                   'o'
193#define AUX_p                   'p'
194#define AUX_q                   'q'
195#define AUX_r                   'r'
196#define AUX_s                   's'
197#define AUX_t                   't'
198#define AUX_u                   'u'
199#define AUX_v                   'v'
200#define AUX_w                   'w'
201#define AUX_x                   'x'
202#define AUX_y                   'y'
203#define AUX_z                   'z'
204#define AUX_0                   '0'
205#define AUX_1                   '1'
206#define AUX_2                   '2'
207#define AUX_3                   '3'
208#define AUX_4                   '4'
209#define AUX_5                   '5'
210#define AUX_6                   '6'
211#define AUX_7                   '7'
212#define AUX_8                   '8'
213#define AUX_9                   '9'
214
215/*
216** ToolKit Gets and Sets
217*/
218#define AUX_FD                  1  /* return fd (long) */
219#define AUX_COLORMAP            3  /* pass buf of r, g and b (unsigned char) */
220#define AUX_GREYSCALEMAP        4
221#define AUX_FOGMAP              5  /* pass fog and color bits (long) */
222#define AUX_ONECOLOR            6  /* pass index, r, g, and b (long) */
223
224/*
225** Color Macros
226*/
227
228#define AUX_BLACK               0
229#define AUX_RED                 13
230#define AUX_GREEN               14
231#define AUX_YELLOW              15
232#define AUX_BLUE                16
233#define AUX_MAGENTA             17
234#define AUX_CYAN                18
235#define AUX_WHITE               19
236
237extern float auxRGBMap[20][3];
238
239#define AUX_SETCOLOR(x, y) (AUX_WIND_IS_RGB((x)) ? \
240                           glColor3fv(auxRGBMap[(y)]) : glIndexf((y)))
241
242/*
243** RGB Image Structure
244*/
245
246typedef struct _AUX_RGBImageRec {
247    GLint sizeX, sizeY;
248    unsigned char *data;
249} AUX_RGBImageRec;
250
251/*
252** Prototypes
253*/
254
255void APIENTRY auxInitDisplayMode(GLenum);
256void APIENTRY auxInitPosition(int, int, int, int);
257
258/* GLenum APIENTRY auxInitWindow(LPCTSTR); */
259#ifdef UNICODE
260#define auxInitWindow auxInitWindowW
261#else
262#define auxInitWindow auxInitWindowA
263#endif
264GLenum APIENTRY auxInitWindowA(LPCSTR);
265GLenum APIENTRY auxInitWindowW(LPCWSTR);
266
267void APIENTRY auxCloseWindow(void);
268void APIENTRY auxQuit(void);
269void APIENTRY auxSwapBuffers(void);
270
271typedef void (CALLBACK* AUXMAINPROC)(void);
272void APIENTRY auxMainLoop(AUXMAINPROC);
273
274typedef void (CALLBACK* AUXEXPOSEPROC)(int, int);
275void APIENTRY auxExposeFunc(AUXEXPOSEPROC);
276
277typedef void (CALLBACK* AUXRESHAPEPROC)(GLsizei, GLsizei);
278void APIENTRY auxReshapeFunc(AUXRESHAPEPROC);
279
280typedef void (CALLBACK* AUXIDLEPROC)(void);
281void APIENTRY auxIdleFunc(AUXIDLEPROC);
282
283typedef void (CALLBACK* AUXKEYPROC)(void);
284void APIENTRY auxKeyFunc(int, AUXKEYPROC);
285
286typedef void (CALLBACK* AUXMOUSEPROC)(AUX_EVENTREC *);
287void APIENTRY auxMouseFunc(int, int, AUXMOUSEPROC);
288
289int  APIENTRY auxGetColorMapSize(void);
290void APIENTRY auxGetMouseLoc(int *, int *);
291void APIENTRY auxSetOneColor(int, float, float, float);
292void APIENTRY auxSetFogRamp(int, int);
293void APIENTRY auxSetGreyRamp(void);
294void APIENTRY auxSetRGBMap(int, float *);
295
296/* AUX_RGBImageRec * APIENTRY auxRGBImageLoad(LPCTSTR); */
297#ifdef UNICODE
298#define auxRGBImageLoad auxRGBImageLoadW
299#else
300#define auxRGBImageLoad auxRGBImageLoadA
301#endif
302AUX_RGBImageRec * APIENTRY auxRGBImageLoadA(LPCSTR);
303AUX_RGBImageRec * APIENTRY auxRGBImageLoadW(LPCWSTR);
304
305#ifdef UNICODE
306#define auxDIBImageLoad auxDIBImageLoadW
307#else
308#define auxDIBImageLoad auxDIBImageLoadA
309#endif
310AUX_RGBImageRec * APIENTRY auxDIBImageLoadA(LPCSTR);
311AUX_RGBImageRec * APIENTRY auxDIBImageLoadW(LPCWSTR);
312
313void APIENTRY auxCreateFont(void);
314/* void APIENTRY auxDrawStr(LPCTSTR); */
315#ifdef UNICODE
316#define auxDrawStr auxDrawStrW
317#else
318#define auxDrawStr auxDrawStrA
319#endif
320void APIENTRY auxDrawStrA(LPCSTR);
321void APIENTRY auxDrawStrW(LPCWSTR);
322
323void APIENTRY auxWireSphere(GLdouble);
324void APIENTRY auxSolidSphere(GLdouble);
325void APIENTRY auxWireCube(GLdouble);
326void APIENTRY auxSolidCube(GLdouble);
327void APIENTRY auxWireBox(GLdouble, GLdouble, GLdouble);
328void APIENTRY auxSolidBox(GLdouble, GLdouble, GLdouble);
329void APIENTRY auxWireTorus(GLdouble, GLdouble);
330void APIENTRY auxSolidTorus(GLdouble, GLdouble);
331void APIENTRY auxWireCylinder(GLdouble, GLdouble);
332void APIENTRY auxSolidCylinder(GLdouble, GLdouble);
333void APIENTRY auxWireIcosahedron(GLdouble);
334void APIENTRY auxSolidIcosahedron(GLdouble);
335void APIENTRY auxWireOctahedron(GLdouble);
336void APIENTRY auxSolidOctahedron(GLdouble);
337void APIENTRY auxWireTetrahedron(GLdouble);
338void APIENTRY auxSolidTetrahedron(GLdouble);
339void APIENTRY auxWireDodecahedron(GLdouble);
340void APIENTRY auxSolidDodecahedron(GLdouble);
341void APIENTRY auxWireCone(GLdouble, GLdouble);
342void APIENTRY auxSolidCone(GLdouble, GLdouble);
343void APIENTRY auxWireTeapot(GLdouble);
344void APIENTRY auxSolidTeapot(GLdouble);
345
346/*
347** Window specific functions
348** hwnd, hdc, and hglrc valid after auxInitWindow()
349*/
350HWND  APIENTRY auxGetHWND(void);
351HDC   APIENTRY auxGetHDC(void);
352HGLRC APIENTRY auxGetHGLRC(void);
353
354/*
355** Viewperf support functions and constants
356*/
357/* Display Mode Selection Criteria */
358enum {
359    AUX_USE_ID = 1,
360    AUX_EXACT_MATCH,
361    AUX_MINIMUM_CRITERIA
362};
363void   APIENTRY auxInitDisplayModePolicy(GLenum);
364GLenum APIENTRY auxInitDisplayModeID(GLint);
365GLenum APIENTRY auxGetDisplayModePolicy(void);
366GLint  APIENTRY auxGetDisplayModeID(void);
367GLenum APIENTRY auxGetDisplayMode(void);
368
369#ifdef __cplusplus
370}
371#endif
372
373#endif /* __GLAUX_H__ */
Note: See TracBrowser for help on using the repository browser.