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