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