source: NonGTP/glut/glut.h @ 816

Revision 816, 30.7 KB checked in by gumbau, 19 years ago (diff)
Line 
1#ifndef __glut_h__
2#define __glut_h__
3
4/* Copyright (c) Mark J. Kilgard, 1994, 1995, 1996, 1998. */
5
6/* This program is freely distributable without licensing fees  and is
7   provided without guarantee or warrantee expressed or  implied. This
8   program is -not- in the public domain. */
9
10#if defined(_MSC_VER) || defined(__MINGW32__)
11#define WIN32_LEAN_AND_MEAN
12#define NO_MIN_MAX
13#include <windows.h>
14#undef min
15#undef max
16#endif
17
18#include <GL/gl.h>
19#include <GL/glu.h>
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25#if defined(_MSC_VER) || defined(__MINGW32__)
26
27/* GLUT 3.7 now tries to avoid including <windows.h>
28   to avoid name space pollution, but Win32's <GL/gl.h>
29   needs APIENTRY and WINGDIAPI defined properly.
30
31   tjump@spgs.com contributes:
32   If users are building glut code on MS Windows, then they should
33   make sure they include windows.h early, let's not get into a
34   header definitions war since MS has proven it's capability to
35   change header dependencies w/o publishing they have done so.
36
37   So, let's not include windows.h here, as it's not really required and
38   MS own gl/gl.h *should* include it if the dependency is there. */
39
40/* To disable automatic library usage for GLUT, define GLUT_NO_LIB_PRAGMA
41   in your compile preprocessor options. */
42# if !defined(GLUT_BUILDING_LIB) && !defined(GLUT_NO_LIB_PRAGMA)
43#  pragma comment (lib, "winmm.lib")      /* link with Windows MultiMedia lib */
44/* To enable automatic SGI OpenGL for Windows library usage for GLUT,
45   define GLUT_USE_SGI_OPENGL in your compile preprocessor options.  */
46#  ifdef GLUT_USE_SGI_OPENGL
47#   pragma comment (lib, "opengl.lib")    /* link with SGI OpenGL for Windows lib */
48#   pragma comment (lib, "glu.lib")       /* link with SGI OpenGL Utility lib */
49#   pragma comment (lib, "glut.lib")      /* link with Win32 GLUT for SGI OpenGL lib */
50#  else
51#   pragma comment (lib, "opengl32.lib")  /* link with Microsoft OpenGL lib */
52#   pragma comment (lib, "glu32.lib")     /* link with Microsoft OpenGL Utility lib */
53#   pragma comment (lib, "glut32.lib")    /* link with Win32 GLUT lib */
54#   pragma comment (lib, "winmm.lib")
55#   pragma comment (lib, "gdi32.lib")     /* Windows GDI */
56#   pragma comment (lib, "advapi32.lib")  /*  */
57#   pragma comment (lib, "user32.lib")    /*  */
58#  endif
59# endif
60
61/* To disable supression of annoying warnings about floats being promoted
62   to doubles, define GLUT_NO_WARNING_DISABLE in your compile preprocessor
63   options. */
64# if !defined(GLUT_NO_WARNING_DISABLE)
65#  pragma warning (disable:4244)  /* Disable bogus VC++ 4.2 conversion warnings. */
66#  pragma warning (disable:4305)  /* VC++ 5.0 version of above warning. */
67# endif
68
69/* Win32 has an annoying issue where there are multiple C run-time
70   libraries (CRTs).  If the executable is linked with a different CRT
71   from the GLUT DLL, the GLUT DLL will not share the same CRT static
72   data seen by the executable.  In particular, atexit callbacks registered
73   in the executable will not be called if GLUT calls its (different)
74   exit routine).  GLUT is typically built with the
75   "/MD" option (the CRT with multithreading DLL support), but the Visual
76   C++ linker default is "/ML" (the single threaded CRT).
77
78   One workaround to this issue is requiring users to always link with
79   the same CRT as GLUT is compiled with.  That requires users supply a
80   non-standard option.  GLUT 3.7 has its own built-in workaround where
81   the executable's "exit" function pointer is covertly passed to GLUT.
82   GLUT then calls the executable's exit function pointer to ensure that
83   any "atexit" calls registered by the application are called if GLUT
84   needs to exit.
85
86   Note that the __glut*WithExit routines should NEVER be called directly.
87   To avoid the atexit workaround, #define GLUT_DISABLE_ATEXIT_HACK. */
88
89/* XXX This is from Win32's <process.h> */
90# if !defined(_MSC_VER) && !defined(__cdecl)
91   /* Define __cdecl for non-Microsoft compilers. */
92#  define __cdecl
93#  define GLUT_DEFINED___CDECL
94# endif
95# ifndef _CRTIMP
96#  ifdef _NTSDK
97    /* Definition compatible with NT SDK */
98#   define _CRTIMP
99#  else
100    /* Current definition */
101#   ifdef _DLL
102#    define _CRTIMP __declspec(dllimport)
103#   else
104#    define _CRTIMP
105#   endif
106#  endif
107#  define GLUT_DEFINED__CRTIMP
108# endif
109# ifndef GLUT_BUILDING_LIB
110#   if _MSC_VER >= 1200
111extern _CRTIMP __declspec(noreturn) void   __cdecl exit(int);
112#     else
113extern _CRTIMP void __cdecl exit(int);
114#   endif
115# endif
116
117/* GLUT callback calling convention for Win32. */
118# define GLUTCALLBACK __cdecl
119
120/* for callback/function pointer defs */
121# define GLUTAPIENTRYV __cdecl
122
123/* glut-win32 specific macros, defined to prevent collision with
124   and redifinition of Windows system defs, also removes requirement of
125   pretty much any standard windows header from this file */
126
127#if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)
128#   define GLUTAPIENTRY __stdcall
129#else
130#   define GLUTAPIENTRY
131#endif
132
133/* GLUT API entry point declarations for Win32. */
134#   define GLUTAPI extern
135
136#if defined(_MSC_VER) && !defined(_WINDEF_) && !defined(MESA)
137#   if !defined(MESA_MINWARN)
138#       pragma message( "note: WINDOWS.H not included, providing Mesa definition of CALLBACK macro" )
139#       pragma message( "----: and PROC typedef. If you receive compiler warnings about either ")
140#       pragma message( "----: being multiply defined you should include WINDOWS.H priot to gl/glut.h" )
141#   endif
142#   define CALLBACK __stdcall
143typedef int (GLUTAPIENTRY *PROC)();
144typedef void *HGLRC;
145typedef void *HDC;
146typedef unsigned long COLORREF;
147#endif
148
149#if defined(_MSC_VER) && !defined(_WINGDI_) && !defined(MESA)
150#   if !defined(MESA_MINWARN)
151#       pragma message( "note: WINDOWS.H not included, providing Mesa definition of wgl functions" )
152#       pragma message( "----: and macros. If you receive compiler warnings about any being multiply ")
153#       pragma message( "----: defined you should include WINDOWS.H priot to gl/glut.h" )
154#   endif
155#   define WGL_FONT_LINES      0
156#   define WGL_FONT_POLYGONS   1
157#   ifdef UNICODE
158#       define wglUseFontBitmaps  wglUseFontBitmapsW
159#       define wglUseFontOutlines  wglUseFontOutlinesW
160#   else
161#       define wglUseFontBitmaps  wglUseFontBitmapsA
162#       define wglUseFontOutlines  wglUseFontOutlinesA
163#   endif /* !UNICODE */
164typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR;
165typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT;
166#  pragma warning( push )
167#  pragma warning( disable : 4273 ) /* 'function' : inconsistent DLL linkage. dllexport assumed. */
168#  define WGLAPI __declspec(dllimport)
169WGLAPI int   GLAPIENTRY wglDeleteContext(HGLRC);
170WGLAPI int   GLAPIENTRY wglMakeCurrent(HDC,HGLRC);
171WGLAPI int   GLAPIENTRY wglSetPixelFormat(HDC, int, const PIXELFORMATDESCRIPTOR *);
172WGLAPI int   GLAPIENTRY wglSwapBuffers(HDC hdc);
173WGLAPI HDC   GLAPIENTRY wglGetCurrentDC(void);
174WGLAPI HGLRC GLAPIENTRY wglCreateContext(HDC);
175WGLAPI HGLRC GLAPIENTRY wglCreateLayerContext(HDC,int);
176WGLAPI HGLRC GLAPIENTRY wglGetCurrentContext(void);
177WGLAPI PROC  GLAPIENTRY wglGetProcAddress(const char*);
178WGLAPI int   GLAPIENTRY wglChoosePixelFormat(HDC, const PIXELFORMATDESCRIPTOR *);
179WGLAPI int   GLAPIENTRY wglCopyContext(HGLRC, HGLRC, unsigned int);
180WGLAPI int   GLAPIENTRY wglDeleteContext(HGLRC);
181WGLAPI int   GLAPIENTRY wglDescribeLayerPlane(HDC, int, int, unsigned int,LPLAYERPLANEDESCRIPTOR);
182WGLAPI int   GLAPIENTRY wglDescribePixelFormat(HDC,int, unsigned int, LPPIXELFORMATDESCRIPTOR);
183WGLAPI int   GLAPIENTRY wglGetLayerPaletteEntries(HDC, int, int, int,COLORREF *);
184WGLAPI int   GLAPIENTRY wglGetPixelFormat(HDC hdc);
185WGLAPI int   GLAPIENTRY wglMakeCurrent(HDC, HGLRC);
186WGLAPI int   GLAPIENTRY wglRealizeLayerPalette(HDC, int, int);
187WGLAPI int   GLAPIENTRY wglSetLayerPaletteEntries(HDC, int, int, int,const COLORREF *);
188WGLAPI int   GLAPIENTRY wglShareLists(HGLRC, HGLRC);
189WGLAPI int   GLAPIENTRY wglSwapLayerBuffers(HDC, unsigned int);
190WGLAPI int   GLAPIENTRY wglUseFontBitmapsA(HDC, unsigned long, unsigned long, unsigned long);
191WGLAPI int   GLAPIENTRY wglUseFontBitmapsW(HDC, unsigned long, unsigned long, unsigned long);
192WGLAPI int   GLAPIENTRY wglUseFontOutlinesA(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
193WGLAPI int   GLAPIENTRY wglUseFontOutlinesW(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
194WGLAPI int   GLAPIENTRY SwapBuffers(HDC);
195WGLAPI int   GLAPIENTRY ChoosePixelFormat(HDC,const PIXELFORMATDESCRIPTOR *);
196WGLAPI int   GLAPIENTRY DescribePixelFormat(HDC,int,unsigned int,LPPIXELFORMATDESCRIPTOR);
197WGLAPI int   GLAPIENTRY GetPixelFormat(HDC);
198WGLAPI int   GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *);
199#  undef WGLAPI
200#  pragma warning( pop )
201#endif
202
203#else /* _MSC_VER not defined */
204
205/* Define GLUTAPIENTRY and GLUTCALLBACK to nothing if we aren't on Win32. */
206#  define GLUTAPIENTRY
207#  define GLUTAPIENTRYV
208#  define GLUT_APIENTRY_DEFINED
209#  define GLUTCALLBACK
210#  define GLUTAPI extern
211/* Prototype exit for the non-Win32 case (see above). */
212/*extern void exit(int);  this screws up gcc -ansi -pedantic! */
213#endif
214
215
216/**
217 GLUT API revision history:
218
219 GLUT_API_VERSION is updated to reflect incompatible GLUT
220 API changes (interface changes, semantic changes, deletions,
221 or additions).
222
223 GLUT_API_VERSION=1  First public release of GLUT.  11/29/94
224
225 GLUT_API_VERSION=2  Added support for OpenGL/GLX multisampling,
226 extension.  Supports new input devices like tablet, dial and button
227 box, and Spaceball.  Easy to query OpenGL extensions.
228
229 GLUT_API_VERSION=3  glutMenuStatus added.
230
231 GLUT_API_VERSION=4  glutInitDisplayString, glutWarpPointer,
232 glutBitmapLength, glutStrokeLength, glutWindowStatusFunc, dynamic
233 video resize subAPI, glutPostWindowRedisplay, glutKeyboardUpFunc,
234 glutSpecialUpFunc, glutIgnoreKeyRepeat, glutSetKeyRepeat,
235 glutJoystickFunc, glutForceJoystickFunc (NOT FINALIZED!).
236
237 GLUT_API_VERSION=5  glutGetProcAddress (added by BrianP)
238**/
239#ifndef GLUT_API_VERSION  /* allow this to be overriden */
240#define GLUT_API_VERSION        5
241#endif
242
243/**
244 GLUT implementation revision history:
245
246 GLUT_XLIB_IMPLEMENTATION is updated to reflect both GLUT
247 API revisions and implementation revisions (ie, bug fixes).
248
249 GLUT_XLIB_IMPLEMENTATION=1  mjk's first public release of
250 GLUT Xlib-based implementation.  11/29/94
251
252 GLUT_XLIB_IMPLEMENTATION=2  mjk's second public release of
253 GLUT Xlib-based implementation providing GLUT version 2
254 interfaces.
255
256 GLUT_XLIB_IMPLEMENTATION=3  mjk's GLUT 2.2 images. 4/17/95
257
258 GLUT_XLIB_IMPLEMENTATION=4  mjk's GLUT 2.3 images. 6/?/95
259
260 GLUT_XLIB_IMPLEMENTATION=5  mjk's GLUT 3.0 images. 10/?/95
261
262 GLUT_XLIB_IMPLEMENTATION=7  mjk's GLUT 3.1+ with glutWarpPoitner.  7/24/96
263
264 GLUT_XLIB_IMPLEMENTATION=8  mjk's GLUT 3.1+ with glutWarpPoitner
265 and video resize.  1/3/97
266
267 GLUT_XLIB_IMPLEMENTATION=9 mjk's GLUT 3.4 release with early GLUT 4 routines.
268
269 GLUT_XLIB_IMPLEMENTATION=11 Mesa 2.5's GLUT 3.6 release.
270
271 GLUT_XLIB_IMPLEMENTATION=12 mjk's GLUT 3.6 release with early GLUT 4 routines + signal handling.
272
273 GLUT_XLIB_IMPLEMENTATION=13 mjk's GLUT 3.7 beta with GameGLUT support.
274
275 GLUT_XLIB_IMPLEMENTATION=14 mjk's GLUT 3.7 beta with f90gl friend interface.
276
277 GLUT_XLIB_IMPLEMENTATION=15 mjk's GLUT 3.7 beta sync'ed with Mesa <GL/glut.h>
278**/
279#ifndef GLUT_XLIB_IMPLEMENTATION  /* Allow this to be overriden. */
280#define GLUT_XLIB_IMPLEMENTATION    15
281#endif
282
283/* Display mode bit masks. */
284#define GLUT_RGB            0
285#define GLUT_RGBA           GLUT_RGB
286#define GLUT_INDEX          1
287#define GLUT_SINGLE         0
288#define GLUT_DOUBLE         2
289#define GLUT_ACCUM          4
290#define GLUT_ALPHA          8
291#define GLUT_DEPTH          16
292#define GLUT_STENCIL            32
293#if (GLUT_API_VERSION >= 2)
294#define GLUT_MULTISAMPLE        128
295#define GLUT_STEREO         256
296#endif
297#if (GLUT_API_VERSION >= 3)
298#define GLUT_LUMINANCE          512
299#endif
300
301/* Mouse buttons. */
302#define GLUT_LEFT_BUTTON        0
303#define GLUT_MIDDLE_BUTTON      1
304#define GLUT_RIGHT_BUTTON       2
305
306/* Mouse button  state. */
307#define GLUT_DOWN           0
308#define GLUT_UP             1
309
310#if (GLUT_API_VERSION >= 2)
311/* function keys */
312#define GLUT_KEY_F1         1
313#define GLUT_KEY_F2         2
314#define GLUT_KEY_F3         3
315#define GLUT_KEY_F4         4
316#define GLUT_KEY_F5         5
317#define GLUT_KEY_F6         6
318#define GLUT_KEY_F7         7
319#define GLUT_KEY_F8         8
320#define GLUT_KEY_F9         9
321#define GLUT_KEY_F10            10
322#define GLUT_KEY_F11            11
323#define GLUT_KEY_F12            12
324/* directional keys */
325#define GLUT_KEY_LEFT           100
326#define GLUT_KEY_UP         101
327#define GLUT_KEY_RIGHT          102
328#define GLUT_KEY_DOWN           103
329#define GLUT_KEY_PAGE_UP        104
330#define GLUT_KEY_PAGE_DOWN      105
331#define GLUT_KEY_HOME           106
332#define GLUT_KEY_END            107
333#define GLUT_KEY_INSERT         108
334#endif
335
336/* Entry/exit  state. */
337#define GLUT_LEFT           0
338#define GLUT_ENTERED            1
339
340/* Menu usage  state. */
341#define GLUT_MENU_NOT_IN_USE        0
342#define GLUT_MENU_IN_USE        1
343
344/* Visibility  state. */
345#define GLUT_NOT_VISIBLE        0
346#define GLUT_VISIBLE            1
347
348/* Window status  state. */
349#define GLUT_HIDDEN         0
350#define GLUT_FULLY_RETAINED     1
351#define GLUT_PARTIALLY_RETAINED     2
352#define GLUT_FULLY_COVERED      3
353
354/* Color index component selection values. */
355#define GLUT_RED            0
356#define GLUT_GREEN          1
357#define GLUT_BLUE           2
358
359/* Layers for use. */
360#define GLUT_NORMAL         0
361#define GLUT_OVERLAY            1
362
363#if defined(_MSC_VER) || defined(__CYGWIN32__) || defined(__MINGW32__)
364/* Stroke font constants (use these in GLUT program). */
365#define GLUT_STROKE_ROMAN       ((void*)0)
366#define GLUT_STROKE_MONO_ROMAN      ((void*)1)
367
368/* Bitmap font constants (use these in GLUT program). */
369#define GLUT_BITMAP_9_BY_15     ((void*)2)
370#define GLUT_BITMAP_8_BY_13     ((void*)3)
371#define GLUT_BITMAP_TIMES_ROMAN_10  ((void*)4)
372#define GLUT_BITMAP_TIMES_ROMAN_24  ((void*)5)
373#if (GLUT_API_VERSION >= 3)
374#define GLUT_BITMAP_HELVETICA_10    ((void*)6)
375#define GLUT_BITMAP_HELVETICA_12    ((void*)7)
376#define GLUT_BITMAP_HELVETICA_18    ((void*)8)
377#endif
378#else
379/* Stroke font opaque addresses (use constants instead in source code). */
380GLUTAPI void *glutStrokeRoman;
381GLUTAPI void *glutStrokeMonoRoman;
382
383/* Stroke font constants (use these in GLUT program). */
384#define GLUT_STROKE_ROMAN       (&glutStrokeRoman)
385#define GLUT_STROKE_MONO_ROMAN      (&glutStrokeMonoRoman)
386
387/* Bitmap font opaque addresses (use constants instead in source code). */
388GLUTAPI void *glutBitmap9By15;
389GLUTAPI void *glutBitmap8By13;
390GLUTAPI void *glutBitmapTimesRoman10;
391GLUTAPI void *glutBitmapTimesRoman24;
392GLUTAPI void *glutBitmapHelvetica10;
393GLUTAPI void *glutBitmapHelvetica12;
394GLUTAPI void *glutBitmapHelvetica18;
395
396/* Bitmap font constants (use these in GLUT program). */
397#define GLUT_BITMAP_9_BY_15     (&glutBitmap9By15)
398#define GLUT_BITMAP_8_BY_13     (&glutBitmap8By13)
399#define GLUT_BITMAP_TIMES_ROMAN_10  (&glutBitmapTimesRoman10)
400#define GLUT_BITMAP_TIMES_ROMAN_24  (&glutBitmapTimesRoman24)
401#if (GLUT_API_VERSION >= 3)
402#define GLUT_BITMAP_HELVETICA_10    (&glutBitmapHelvetica10)
403#define GLUT_BITMAP_HELVETICA_12    (&glutBitmapHelvetica12)
404#define GLUT_BITMAP_HELVETICA_18    (&glutBitmapHelvetica18)
405#endif
406#endif
407
408/* glutGet parameters. */
409#define GLUT_WINDOW_X           100
410#define GLUT_WINDOW_Y           101
411#define GLUT_WINDOW_WIDTH       102
412#define GLUT_WINDOW_HEIGHT      103
413#define GLUT_WINDOW_BUFFER_SIZE     104
414#define GLUT_WINDOW_STENCIL_SIZE    105
415#define GLUT_WINDOW_DEPTH_SIZE      106
416#define GLUT_WINDOW_RED_SIZE        107
417#define GLUT_WINDOW_GREEN_SIZE      108
418#define GLUT_WINDOW_BLUE_SIZE       109
419#define GLUT_WINDOW_ALPHA_SIZE      110
420#define GLUT_WINDOW_ACCUM_RED_SIZE  111
421#define GLUT_WINDOW_ACCUM_GREEN_SIZE    112
422#define GLUT_WINDOW_ACCUM_BLUE_SIZE 113
423#define GLUT_WINDOW_ACCUM_ALPHA_SIZE    114
424#define GLUT_WINDOW_DOUBLEBUFFER    115
425#define GLUT_WINDOW_RGBA        116
426#define GLUT_WINDOW_PARENT      117
427#define GLUT_WINDOW_NUM_CHILDREN    118
428#define GLUT_WINDOW_COLORMAP_SIZE   119
429#if (GLUT_API_VERSION >= 2)
430#define GLUT_WINDOW_NUM_SAMPLES     120
431#define GLUT_WINDOW_STEREO      121
432#endif
433#if (GLUT_API_VERSION >= 3)
434#define GLUT_WINDOW_CURSOR      122
435#endif
436#define GLUT_SCREEN_WIDTH       200
437#define GLUT_SCREEN_HEIGHT      201
438#define GLUT_SCREEN_WIDTH_MM        202
439#define GLUT_SCREEN_HEIGHT_MM       203
440#define GLUT_MENU_NUM_ITEMS     300
441#define GLUT_DISPLAY_MODE_POSSIBLE  400
442#define GLUT_INIT_WINDOW_X      500
443#define GLUT_INIT_WINDOW_Y      501
444#define GLUT_INIT_WINDOW_WIDTH      502
445#define GLUT_INIT_WINDOW_HEIGHT     503
446#define GLUT_INIT_DISPLAY_MODE      504
447#if (GLUT_API_VERSION >= 2)
448#define GLUT_ELAPSED_TIME       700
449#endif
450#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
451#define GLUT_WINDOW_FORMAT_ID       123
452#endif
453
454#if (GLUT_API_VERSION >= 2)
455/* glutDeviceGet parameters. */
456#define GLUT_HAS_KEYBOARD       600
457#define GLUT_HAS_MOUSE          601
458#define GLUT_HAS_SPACEBALL      602
459#define GLUT_HAS_DIAL_AND_BUTTON_BOX    603
460#define GLUT_HAS_TABLET         604
461#define GLUT_NUM_MOUSE_BUTTONS      605
462#define GLUT_NUM_SPACEBALL_BUTTONS  606
463#define GLUT_NUM_BUTTON_BOX_BUTTONS 607
464#define GLUT_NUM_DIALS          608
465#define GLUT_NUM_TABLET_BUTTONS     609
466#endif
467#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
468#define GLUT_DEVICE_IGNORE_KEY_REPEAT   610
469#define GLUT_DEVICE_KEY_REPEAT          611
470#define GLUT_HAS_JOYSTICK       612
471#define GLUT_OWNS_JOYSTICK      613
472#define GLUT_JOYSTICK_BUTTONS       614
473#define GLUT_JOYSTICK_AXES      615
474#define GLUT_JOYSTICK_POLL_RATE     616
475#endif
476
477#if (GLUT_API_VERSION >= 3)
478/* glutLayerGet parameters. */
479#define GLUT_OVERLAY_POSSIBLE           800
480#define GLUT_LAYER_IN_USE       801
481#define GLUT_HAS_OVERLAY        802
482#define GLUT_TRANSPARENT_INDEX      803
483#define GLUT_NORMAL_DAMAGED     804
484#define GLUT_OVERLAY_DAMAGED        805
485
486#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
487/* glutVideoResizeGet parameters. */
488#define GLUT_VIDEO_RESIZE_POSSIBLE  900
489#define GLUT_VIDEO_RESIZE_IN_USE    901
490#define GLUT_VIDEO_RESIZE_X_DELTA   902
491#define GLUT_VIDEO_RESIZE_Y_DELTA   903
492#define GLUT_VIDEO_RESIZE_WIDTH_DELTA   904
493#define GLUT_VIDEO_RESIZE_HEIGHT_DELTA  905
494#define GLUT_VIDEO_RESIZE_X     906
495#define GLUT_VIDEO_RESIZE_Y     907
496#define GLUT_VIDEO_RESIZE_WIDTH     908
497#define GLUT_VIDEO_RESIZE_HEIGHT    909
498#endif
499
500/* glutUseLayer parameters. */
501#define GLUT_NORMAL         0
502#define GLUT_OVERLAY            1
503
504/* glutGetModifiers return mask. */
505#define GLUT_ACTIVE_SHIFT               1
506#define GLUT_ACTIVE_CTRL                2
507#define GLUT_ACTIVE_ALT                 4
508
509/* glutSetCursor parameters. */
510/* Basic arrows. */
511#define GLUT_CURSOR_RIGHT_ARROW     0
512#define GLUT_CURSOR_LEFT_ARROW      1
513/* Symbolic cursor shapes. */
514#define GLUT_CURSOR_INFO        2
515#define GLUT_CURSOR_DESTROY     3
516#define GLUT_CURSOR_HELP        4
517#define GLUT_CURSOR_CYCLE       5
518#define GLUT_CURSOR_SPRAY       6
519#define GLUT_CURSOR_WAIT        7
520#define GLUT_CURSOR_TEXT        8
521#define GLUT_CURSOR_CROSSHAIR       9
522/* Directional cursors. */
523#define GLUT_CURSOR_UP_DOWN     10
524#define GLUT_CURSOR_LEFT_RIGHT      11
525/* Sizing cursors. */
526#define GLUT_CURSOR_TOP_SIDE        12
527#define GLUT_CURSOR_BOTTOM_SIDE     13
528#define GLUT_CURSOR_LEFT_SIDE       14
529#define GLUT_CURSOR_RIGHT_SIDE      15
530#define GLUT_CURSOR_TOP_LEFT_CORNER 16
531#define GLUT_CURSOR_TOP_RIGHT_CORNER    17
532#define GLUT_CURSOR_BOTTOM_RIGHT_CORNER 18
533#define GLUT_CURSOR_BOTTOM_LEFT_CORNER  19
534/* Inherit from parent window. */
535#define GLUT_CURSOR_INHERIT     100
536/* Blank cursor. */
537#define GLUT_CURSOR_NONE        101
538/* Fullscreen crosshair (if available). */
539#define GLUT_CURSOR_FULL_CROSSHAIR  102
540#endif
541
542/* GLUT initialization sub-API. */
543GLUTAPI void GLUTAPIENTRY glutInit(int *argcp, char **argv);
544#if defined(_MSC_VER) && !defined(GLUT_DISABLE_ATEXIT_HACK)
545GLUTAPI void GLUTAPIENTRY __glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int));
546#ifndef GLUT_BUILDING_LIB
547static void GLUTAPIENTRY glutInit_ATEXIT_HACK(int *argcp, char **argv) { __glutInitWithExit(argcp, argv, exit); }
548#define glutInit glutInit_ATEXIT_HACK
549#endif
550#endif
551GLUTAPI void GLUTAPIENTRY glutInitDisplayMode(unsigned int mode);
552#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
553GLUTAPI void GLUTAPIENTRY glutInitDisplayString(const char *string);
554#endif
555GLUTAPI void GLUTAPIENTRY glutInitWindowPosition(int x, int y);
556GLUTAPI void GLUTAPIENTRY glutInitWindowSize(int width, int height);
557GLUTAPI void GLUTAPIENTRY glutMainLoop(void);
558
559/* GLUT window sub-API. */
560GLUTAPI int GLUTAPIENTRY glutCreateWindow(const char *title);
561#if defined(_MSC_VER) && !defined(GLUT_DISABLE_ATEXIT_HACK)
562GLUTAPI int GLUTAPIENTRY __glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int));
563#ifndef GLUT_BUILDING_LIB
564static int GLUTAPIENTRY glutCreateWindow_ATEXIT_HACK(const char *title) { return __glutCreateWindowWithExit(title, exit); }
565#define glutCreateWindow glutCreateWindow_ATEXIT_HACK
566#endif
567#endif
568GLUTAPI int GLUTAPIENTRY glutCreateSubWindow(int win, int x, int y, int width, int height);
569GLUTAPI void GLUTAPIENTRY glutDestroyWindow(int win);
570GLUTAPI void GLUTAPIENTRY glutPostRedisplay(void);
571#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
572GLUTAPI void GLUTAPIENTRY glutPostWindowRedisplay(int win);
573#endif
574GLUTAPI void GLUTAPIENTRY glutSwapBuffers(void);
575GLUTAPI int GLUTAPIENTRY glutGetWindow(void);
576GLUTAPI void GLUTAPIENTRY glutSetWindow(int win);
577GLUTAPI void GLUTAPIENTRY glutSetWindowTitle(const char *title);
578GLUTAPI void GLUTAPIENTRY glutSetIconTitle(const char *title);
579GLUTAPI void GLUTAPIENTRY glutPositionWindow(int x, int y);
580GLUTAPI void GLUTAPIENTRY glutReshapeWindow(int width, int height);
581GLUTAPI void GLUTAPIENTRY glutPopWindow(void);
582GLUTAPI void GLUTAPIENTRY glutPushWindow(void);
583GLUTAPI void GLUTAPIENTRY glutIconifyWindow(void);
584GLUTAPI void GLUTAPIENTRY glutShowWindow(void);
585GLUTAPI void GLUTAPIENTRY glutHideWindow(void);
586#if (GLUT_API_VERSION >= 3)
587GLUTAPI void GLUTAPIENTRY glutFullScreen(void);
588GLUTAPI void GLUTAPIENTRY glutSetCursor(int cursor);
589#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
590GLUTAPI void GLUTAPIENTRY glutWarpPointer(int x, int y);
591#endif
592
593/* GLUT overlay sub-API. */
594GLUTAPI void GLUTAPIENTRY glutEstablishOverlay(void);
595GLUTAPI void GLUTAPIENTRY glutRemoveOverlay(void);
596GLUTAPI void GLUTAPIENTRY glutUseLayer(GLenum layer);
597GLUTAPI void GLUTAPIENTRY glutPostOverlayRedisplay(void);
598#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
599GLUTAPI void GLUTAPIENTRY glutPostWindowOverlayRedisplay(int win);
600#endif
601GLUTAPI void GLUTAPIENTRY glutShowOverlay(void);
602GLUTAPI void GLUTAPIENTRY glutHideOverlay(void);
603#endif
604
605/* GLUT menu sub-API. */
606GLUTAPI int GLUTAPIENTRY glutCreateMenu(void (GLUTCALLBACK *func)(int));
607#if defined(_MSC_VER) && !defined(GLUT_DISABLE_ATEXIT_HACK)
608GLUTAPI int GLUTAPIENTRY __glutCreateMenuWithExit(void (GLUTCALLBACK *func)(int), void (__cdecl *exitfunc)(int));
609#ifndef GLUT_BUILDING_LIB
610static int GLUTAPIENTRY glutCreateMenu_ATEXIT_HACK(void (GLUTCALLBACK *func)(int)) { return __glutCreateMenuWithExit(func, exit); }
611#define glutCreateMenu glutCreateMenu_ATEXIT_HACK
612#endif
613#endif
614GLUTAPI void GLUTAPIENTRY glutDestroyMenu(int menu);
615GLUTAPI int GLUTAPIENTRY glutGetMenu(void);
616GLUTAPI void GLUTAPIENTRY glutSetMenu(int menu);
617GLUTAPI void GLUTAPIENTRY glutAddMenuEntry(const char *label, int value);
618GLUTAPI void GLUTAPIENTRY glutAddSubMenu(const char *label, int submenu);
619GLUTAPI void GLUTAPIENTRY glutChangeToMenuEntry(int item, const char *label, int value);
620GLUTAPI void GLUTAPIENTRY glutChangeToSubMenu(int item, const char *label, int submenu);
621GLUTAPI void GLUTAPIENTRY glutRemoveMenuItem(int item);
622GLUTAPI void GLUTAPIENTRY glutAttachMenu(int button);
623GLUTAPI void GLUTAPIENTRY glutDetachMenu(int button);
624
625/* GLUT window callback sub-API. */
626GLUTAPI void GLUTAPIENTRY glutDisplayFunc(void (GLUTCALLBACK *func)(void));
627GLUTAPI void GLUTAPIENTRY glutReshapeFunc(void (GLUTCALLBACK *func)(int width, int height));
628GLUTAPI void GLUTAPIENTRY glutKeyboardFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y));
629GLUTAPI void GLUTAPIENTRY glutMouseFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y));
630GLUTAPI void GLUTAPIENTRY glutMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
631GLUTAPI void GLUTAPIENTRY glutPassiveMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
632GLUTAPI void GLUTAPIENTRY glutEntryFunc(void (GLUTCALLBACK *func)(int state));
633GLUTAPI void GLUTAPIENTRY glutVisibilityFunc(void (GLUTCALLBACK *func)(int state));
634GLUTAPI void GLUTAPIENTRY glutIdleFunc(void (GLUTCALLBACK *func)(void));
635GLUTAPI void GLUTAPIENTRY glutTimerFunc(unsigned int millis, void (GLUTCALLBACK *func)(int value), int value);
636GLUTAPI void GLUTAPIENTRY glutMenuStateFunc(void (GLUTCALLBACK *func)(int state));
637#if (GLUT_API_VERSION >= 2)
638GLUTAPI void GLUTAPIENTRY glutSpecialFunc(void (GLUTCALLBACK *func)(int key, int x, int y));
639GLUTAPI void GLUTAPIENTRY glutSpaceballMotionFunc(void (GLUTCALLBACK *func)(int x, int y, int z));
640GLUTAPI void GLUTAPIENTRY glutSpaceballRotateFunc(void (GLUTCALLBACK *func)(int x, int y, int z));
641GLUTAPI void GLUTAPIENTRY glutSpaceballButtonFunc(void (GLUTCALLBACK *func)(int button, int state));
642GLUTAPI void GLUTAPIENTRY glutButtonBoxFunc(void (GLUTCALLBACK *func)(int button, int state));
643GLUTAPI void GLUTAPIENTRY glutDialsFunc(void (GLUTCALLBACK *func)(int dial, int value));
644GLUTAPI void GLUTAPIENTRY glutTabletMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
645GLUTAPI void GLUTAPIENTRY glutTabletButtonFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y));
646#if (GLUT_API_VERSION >= 3)
647GLUTAPI void GLUTAPIENTRY glutMenuStatusFunc(void (GLUTCALLBACK *func)(int status, int x, int y));
648GLUTAPI void GLUTAPIENTRY glutOverlayDisplayFunc(void (GLUTCALLBACK *func)(void));
649#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
650GLUTAPI void GLUTAPIENTRY glutWindowStatusFunc(void (GLUTCALLBACK *func)(int state));
651#endif
652#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
653GLUTAPI void GLUTAPIENTRY glutKeyboardUpFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y));
654GLUTAPI void GLUTAPIENTRY glutSpecialUpFunc(void (GLUTCALLBACK *func)(int key, int x, int y));
655GLUTAPI void GLUTAPIENTRY glutJoystickFunc(void (GLUTCALLBACK *func)(unsigned int buttonMask, int x, int y, int z), int pollInterval);
656#endif
657#endif
658#endif
659
660/* GLUT color index sub-API. */
661GLUTAPI void GLUTAPIENTRY glutSetColor(int, GLfloat red, GLfloat green, GLfloat blue);
662GLUTAPI GLfloat GLUTAPIENTRY glutGetColor(int ndx, int component);
663GLUTAPI void GLUTAPIENTRY glutCopyColormap(int win);
664
665/* GLUT state retrieval sub-API. */
666GLUTAPI int GLUTAPIENTRY glutGet(GLenum type);
667GLUTAPI int GLUTAPIENTRY glutDeviceGet(GLenum type);
668#if (GLUT_API_VERSION >= 2)
669/* GLUT extension support sub-API */
670GLUTAPI int GLUTAPIENTRY glutExtensionSupported(const char *name);
671#endif
672#if (GLUT_API_VERSION >= 3)
673GLUTAPI int GLUTAPIENTRY glutGetModifiers(void);
674GLUTAPI int GLUTAPIENTRY glutLayerGet(GLenum type);
675#endif
676#if (GLUT_API_VERSION >= 5)
677GLUTAPI void * GLUTAPIENTRY glutGetProcAddress(const char *procName);
678#endif
679
680/* GLUT font sub-API */
681GLUTAPI void GLUTAPIENTRY glutBitmapCharacter(void *font, int character);
682GLUTAPI int GLUTAPIENTRY glutBitmapWidth(void *font, int character);
683GLUTAPI void GLUTAPIENTRY glutStrokeCharacter(void *font, int character);
684GLUTAPI int GLUTAPIENTRY glutStrokeWidth(void *font, int character);
685#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
686GLUTAPI int GLUTAPIENTRY glutBitmapLength(void *font, const unsigned char *string);
687GLUTAPI int GLUTAPIENTRY glutStrokeLength(void *font, const unsigned char *string);
688#endif
689
690/* GLUT pre-built models sub-API */
691GLUTAPI void GLUTAPIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks);
692GLUTAPI void GLUTAPIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks);
693GLUTAPI void GLUTAPIENTRY glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
694GLUTAPI void GLUTAPIENTRY glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
695GLUTAPI void GLUTAPIENTRY glutWireCube(GLdouble size);
696GLUTAPI void GLUTAPIENTRY glutSolidCube(GLdouble size);
697GLUTAPI void GLUTAPIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
698GLUTAPI void GLUTAPIENTRY glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
699GLUTAPI void GLUTAPIENTRY glutWireDodecahedron(void);
700GLUTAPI void GLUTAPIENTRY glutSolidDodecahedron(void);
701GLUTAPI void GLUTAPIENTRY glutWireTeapot(GLdouble size);
702GLUTAPI void GLUTAPIENTRY glutSolidTeapot(GLdouble size);
703GLUTAPI void GLUTAPIENTRY glutWireOctahedron(void);
704GLUTAPI void GLUTAPIENTRY glutSolidOctahedron(void);
705GLUTAPI void GLUTAPIENTRY glutWireTetrahedron(void);
706GLUTAPI void GLUTAPIENTRY glutSolidTetrahedron(void);
707GLUTAPI void GLUTAPIENTRY glutWireIcosahedron(void);
708GLUTAPI void GLUTAPIENTRY glutSolidIcosahedron(void);
709
710#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
711/* GLUT video resize sub-API. */
712GLUTAPI int GLUTAPIENTRY glutVideoResizeGet(GLenum param);
713GLUTAPI void GLUTAPIENTRY glutSetupVideoResizing(void);
714GLUTAPI void GLUTAPIENTRY glutStopVideoResizing(void);
715GLUTAPI void GLUTAPIENTRY glutVideoResize(int x, int y, int width, int height);
716GLUTAPI void GLUTAPIENTRY glutVideoPan(int x, int y, int width, int height);
717
718/* GLUT debugging sub-API. */
719GLUTAPI void GLUTAPIENTRY glutReportErrors(void);
720#endif
721
722#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
723/* GLUT device control sub-API. */
724/* glutSetKeyRepeat modes. */
725#define GLUT_KEY_REPEAT_OFF     0
726#define GLUT_KEY_REPEAT_ON      1
727#define GLUT_KEY_REPEAT_DEFAULT     2
728
729/* Joystick button masks. */
730#define GLUT_JOYSTICK_BUTTON_A      1
731#define GLUT_JOYSTICK_BUTTON_B      2
732#define GLUT_JOYSTICK_BUTTON_C      4
733#define GLUT_JOYSTICK_BUTTON_D      8
734
735GLUTAPI void GLUTAPIENTRY glutIgnoreKeyRepeat(int ignore);
736GLUTAPI void GLUTAPIENTRY glutSetKeyRepeat(int repeatMode);
737GLUTAPI void GLUTAPIENTRY glutForceJoystickFunc(void);
738
739/* GLUT game mode sub-API. */
740/* glutGameModeGet. */
741#define GLUT_GAME_MODE_ACTIVE           0
742#define GLUT_GAME_MODE_POSSIBLE         1
743#define GLUT_GAME_MODE_WIDTH            2
744#define GLUT_GAME_MODE_HEIGHT           3
745#define GLUT_GAME_MODE_PIXEL_DEPTH      4
746#define GLUT_GAME_MODE_REFRESH_RATE     5
747#define GLUT_GAME_MODE_DISPLAY_CHANGED  6
748
749GLUTAPI void GLUTAPIENTRY glutGameModeString(const char *string);
750GLUTAPI int GLUTAPIENTRY glutEnterGameMode(void);
751GLUTAPI void GLUTAPIENTRY glutLeaveGameMode(void);
752GLUTAPI int GLUTAPIENTRY glutGameModeGet(GLenum mode);
753#endif
754
755#ifdef __cplusplus
756}
757#endif
758
759#if 0
760#ifdef GLUT_APIENTRY_DEFINED
761# undef GLUT_APIENTRY_DEFINED
762# undef APIENTRY
763#endif
764
765#ifdef GLUT_WINGDIAPI_DEFINED
766# undef GLUT_WINGDIAPI_DEFINED
767# undef WINGDIAPI
768#endif
769
770#ifdef GLUT_DEFINED___CDECL
771# undef GLUT_DEFINED___CDECL
772# undef __cdecl
773#endif
774
775#ifdef GLUT_DEFINED__CRTIMP
776# undef GLUT_DEFINED__CRTIMP
777# undef _CRTIMP
778#endif
779#endif
780
781#endif                  /* __glut_h__ */
Note: See TracBrowser for help on using the repository browser.