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(_MSC_VER) && !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
77 #if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
81 /* GLUT callback calling convention for Win32. */
82 # define GLUTCALLBACK __cdecl
84 /* for callback/function pointer defs */
85 # define GLUTAPIENTRYV __cdecl
87 /* glut-win32 specific macros, defined to prevent collision with
88 and redifinition of Windows system defs, also removes requirement of
89 pretty much any standard windows header from this file */
91 #if (_MSC_VER >= 800) || defined(__MINGW32__) || defined(_STDCALL_SUPPORTED) || defined(__CYGWIN32__)
92 # define GLUTAPIENTRY __stdcall
97 /* GLUT API entry point declarations for Win32. */
98 #if (defined(BUILD_GLUT32) || defined(GLUT_BUILDING_LIB)) && !defined(GLUT_STATIC)
99 # define GLUTAPI __declspec(dllexport)
100 #elif !defined(GLUT_STATIC)
101 # define GLUTAPI __declspec(dllimport)
103 # define GLUTAPI extern
106 #elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303
108 # define GLUTAPIENTRY
109 # define GLUTAPIENTRYV
110 # define GLUTCALLBACK
111 # define GLUTAPI extern __attribute__((visibility("default")))
115 /* Define GLUTAPIENTRY and GLUTCALLBACK to nothing */
116 # define GLUTAPIENTRY
117 # define GLUTAPIENTRYV
118 # define GLUTCALLBACK
119 # define GLUTAPI extern
125 GLUT API revision history:
127 GLUT_API_VERSION is updated to reflect incompatible GLUT
128 API changes (interface changes, semantic changes, deletions,
131 GLUT_API_VERSION=1 First public release of GLUT. 11/29/94
133 GLUT_API_VERSION=2 Added support for OpenGL/GLX multisampling,
134 extension. Supports new input devices like tablet, dial and button
135 box, and Spaceball. Easy to query OpenGL extensions.
137 GLUT_API_VERSION=3 glutMenuStatus added.
139 GLUT_API_VERSION=4 glutInitDisplayString, glutWarpPointer,
140 glutBitmapLength, glutStrokeLength, glutWindowStatusFunc, dynamic
141 video resize subAPI, glutPostWindowRedisplay, glutKeyboardUpFunc,
142 glutSpecialUpFunc, glutIgnoreKeyRepeat, glutSetKeyRepeat,
143 glutJoystickFunc, glutForceJoystickFunc (NOT FINALIZED!).
145 GLUT_API_VERSION=5 glutGetProcAddress (added by BrianP)
147 #ifndef GLUT_API_VERSION /* allow this to be overriden */
148 #define GLUT_API_VERSION 5
152 GLUT implementation revision history:
154 GLUT_XLIB_IMPLEMENTATION is updated to reflect both GLUT
155 API revisions and implementation revisions (ie, bug fixes).
157 GLUT_XLIB_IMPLEMENTATION=1 mjk's first public release of
158 GLUT Xlib-based implementation. 11/29/94
160 GLUT_XLIB_IMPLEMENTATION=2 mjk's second public release of
161 GLUT Xlib-based implementation providing GLUT version 2
164 GLUT_XLIB_IMPLEMENTATION=3 mjk's GLUT 2.2 images. 4/17/95
166 GLUT_XLIB_IMPLEMENTATION=4 mjk's GLUT 2.3 images. 6/?/95
168 GLUT_XLIB_IMPLEMENTATION=5 mjk's GLUT 3.0 images. 10/?/95
170 GLUT_XLIB_IMPLEMENTATION=7 mjk's GLUT 3.1+ with glutWarpPoitner. 7/24/96
172 GLUT_XLIB_IMPLEMENTATION=8 mjk's GLUT 3.1+ with glutWarpPoitner
173 and video resize. 1/3/97
175 GLUT_XLIB_IMPLEMENTATION=9 mjk's GLUT 3.4 release with early GLUT 4 routines.
177 GLUT_XLIB_IMPLEMENTATION=11 Mesa 2.5's GLUT 3.6 release.
179 GLUT_XLIB_IMPLEMENTATION=12 mjk's GLUT 3.6 release with early GLUT 4 routines + signal handling.
181 GLUT_XLIB_IMPLEMENTATION=13 mjk's GLUT 3.7 beta with GameGLUT support.
183 GLUT_XLIB_IMPLEMENTATION=14 mjk's GLUT 3.7 beta with f90gl friend interface.
185 GLUT_XLIB_IMPLEMENTATION=15 mjk's GLUT 3.7 beta sync'ed with Mesa <GL/glut.h>
187 #ifndef GLUT_XLIB_IMPLEMENTATION /* Allow this to be overriden. */
188 #define GLUT_XLIB_IMPLEMENTATION 15
191 /* Display mode bit masks. */
193 #define GLUT_RGBA GLUT_RGB
195 #define GLUT_SINGLE 0
196 #define GLUT_DOUBLE 2
199 #define GLUT_DEPTH 16
200 #define GLUT_STENCIL 32
201 #if (GLUT_API_VERSION >= 2)
202 #define GLUT_MULTISAMPLE 128
203 #define GLUT_STEREO 256
205 #if (GLUT_API_VERSION >= 3)
206 #define GLUT_LUMINANCE 512
210 #define GLUT_LEFT_BUTTON 0
211 #define GLUT_MIDDLE_BUTTON 1
212 #define GLUT_RIGHT_BUTTON 2
214 /* Mouse button state. */
218 #if (GLUT_API_VERSION >= 2)
220 #define GLUT_KEY_F1 1
221 #define GLUT_KEY_F2 2
222 #define GLUT_KEY_F3 3
223 #define GLUT_KEY_F4 4
224 #define GLUT_KEY_F5 5
225 #define GLUT_KEY_F6 6
226 #define GLUT_KEY_F7 7
227 #define GLUT_KEY_F8 8
228 #define GLUT_KEY_F9 9
229 #define GLUT_KEY_F10 10
230 #define GLUT_KEY_F11 11
231 #define GLUT_KEY_F12 12
232 /* directional keys */
233 #define GLUT_KEY_LEFT 100
234 #define GLUT_KEY_UP 101
235 #define GLUT_KEY_RIGHT 102
236 #define GLUT_KEY_DOWN 103
237 #define GLUT_KEY_PAGE_UP 104
238 #define GLUT_KEY_PAGE_DOWN 105
239 #define GLUT_KEY_HOME 106
240 #define GLUT_KEY_END 107
241 #define GLUT_KEY_INSERT 108
244 /* Entry/exit state. */
246 #define GLUT_ENTERED 1
248 /* Menu usage state. */
249 #define GLUT_MENU_NOT_IN_USE 0
250 #define GLUT_MENU_IN_USE 1
252 /* Visibility state. */
253 #define GLUT_NOT_VISIBLE 0
254 #define GLUT_VISIBLE 1
256 /* Window status state. */
257 #define GLUT_HIDDEN 0
258 #define GLUT_FULLY_RETAINED 1
259 #define GLUT_PARTIALLY_RETAINED 2
260 #define GLUT_FULLY_COVERED 3
262 /* Color index component selection values. */
267 /* Layers for use. */
268 #define GLUT_NORMAL 0
269 #define GLUT_OVERLAY 1
271 #if defined(_WIN32) || defined (GLUT_IMPORT_LIB)
272 /* Stroke font constants (use these in GLUT program). */
273 #define GLUT_STROKE_ROMAN ((void*)0)
274 #define GLUT_STROKE_MONO_ROMAN ((void*)1)
276 /* Bitmap font constants (use these in GLUT program). */
277 #define GLUT_BITMAP_9_BY_15 ((void*)2)
278 #define GLUT_BITMAP_8_BY_13 ((void*)3)
279 #define GLUT_BITMAP_TIMES_ROMAN_10 ((void*)4)
280 #define GLUT_BITMAP_TIMES_ROMAN_24 ((void*)5)
281 #if (GLUT_API_VERSION >= 3)
282 #define GLUT_BITMAP_HELVETICA_10 ((void*)6)
283 #define GLUT_BITMAP_HELVETICA_12 ((void*)7)
284 #define GLUT_BITMAP_HELVETICA_18 ((void*)8)
287 /* Stroke font opaque addresses (use constants instead in source code). */
288 GLUTAPI
void *glutStrokeRoman
;
289 GLUTAPI
void *glutStrokeMonoRoman
;
291 /* Stroke font constants (use these in GLUT program). */
292 #define GLUT_STROKE_ROMAN (&glutStrokeRoman)
293 #define GLUT_STROKE_MONO_ROMAN (&glutStrokeMonoRoman)
295 /* Bitmap font opaque addresses (use constants instead in source code). */
296 GLUTAPI
void *glutBitmap9By15
;
297 GLUTAPI
void *glutBitmap8By13
;
298 GLUTAPI
void *glutBitmapTimesRoman10
;
299 GLUTAPI
void *glutBitmapTimesRoman24
;
300 GLUTAPI
void *glutBitmapHelvetica10
;
301 GLUTAPI
void *glutBitmapHelvetica12
;
302 GLUTAPI
void *glutBitmapHelvetica18
;
304 /* Bitmap font constants (use these in GLUT program). */
305 #define GLUT_BITMAP_9_BY_15 (&glutBitmap9By15)
306 #define GLUT_BITMAP_8_BY_13 (&glutBitmap8By13)
307 #define GLUT_BITMAP_TIMES_ROMAN_10 (&glutBitmapTimesRoman10)
308 #define GLUT_BITMAP_TIMES_ROMAN_24 (&glutBitmapTimesRoman24)
309 #if (GLUT_API_VERSION >= 3)
310 #define GLUT_BITMAP_HELVETICA_10 (&glutBitmapHelvetica10)
311 #define GLUT_BITMAP_HELVETICA_12 (&glutBitmapHelvetica12)
312 #define GLUT_BITMAP_HELVETICA_18 (&glutBitmapHelvetica18)
316 /* glutGet parameters. */
317 #define GLUT_WINDOW_X 100
318 #define GLUT_WINDOW_Y 101
319 #define GLUT_WINDOW_WIDTH 102
320 #define GLUT_WINDOW_HEIGHT 103
321 #define GLUT_WINDOW_BUFFER_SIZE 104
322 #define GLUT_WINDOW_STENCIL_SIZE 105
323 #define GLUT_WINDOW_DEPTH_SIZE 106
324 #define GLUT_WINDOW_RED_SIZE 107
325 #define GLUT_WINDOW_GREEN_SIZE 108
326 #define GLUT_WINDOW_BLUE_SIZE 109
327 #define GLUT_WINDOW_ALPHA_SIZE 110
328 #define GLUT_WINDOW_ACCUM_RED_SIZE 111
329 #define GLUT_WINDOW_ACCUM_GREEN_SIZE 112
330 #define GLUT_WINDOW_ACCUM_BLUE_SIZE 113
331 #define GLUT_WINDOW_ACCUM_ALPHA_SIZE 114
332 #define GLUT_WINDOW_DOUBLEBUFFER 115
333 #define GLUT_WINDOW_RGBA 116
334 #define GLUT_WINDOW_PARENT 117
335 #define GLUT_WINDOW_NUM_CHILDREN 118
336 #define GLUT_WINDOW_COLORMAP_SIZE 119
337 #if (GLUT_API_VERSION >= 2)
338 #define GLUT_WINDOW_NUM_SAMPLES 120
339 #define GLUT_WINDOW_STEREO 121
341 #if (GLUT_API_VERSION >= 3)
342 #define GLUT_WINDOW_CURSOR 122
344 #define GLUT_SCREEN_WIDTH 200
345 #define GLUT_SCREEN_HEIGHT 201
346 #define GLUT_SCREEN_WIDTH_MM 202
347 #define GLUT_SCREEN_HEIGHT_MM 203
348 #define GLUT_MENU_NUM_ITEMS 300
349 #define GLUT_DISPLAY_MODE_POSSIBLE 400
350 #define GLUT_INIT_WINDOW_X 500
351 #define GLUT_INIT_WINDOW_Y 501
352 #define GLUT_INIT_WINDOW_WIDTH 502
353 #define GLUT_INIT_WINDOW_HEIGHT 503
354 #define GLUT_INIT_DISPLAY_MODE 504
355 #if (GLUT_API_VERSION >= 2)
356 #define GLUT_ELAPSED_TIME 700
358 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
359 #define GLUT_WINDOW_FORMAT_ID 123
362 #if (GLUT_API_VERSION >= 2)
363 /* glutDeviceGet parameters. */
364 #define GLUT_HAS_KEYBOARD 600
365 #define GLUT_HAS_MOUSE 601
366 #define GLUT_HAS_SPACEBALL 602
367 #define GLUT_HAS_DIAL_AND_BUTTON_BOX 603
368 #define GLUT_HAS_TABLET 604
369 #define GLUT_NUM_MOUSE_BUTTONS 605
370 #define GLUT_NUM_SPACEBALL_BUTTONS 606
371 #define GLUT_NUM_BUTTON_BOX_BUTTONS 607
372 #define GLUT_NUM_DIALS 608
373 #define GLUT_NUM_TABLET_BUTTONS 609
375 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
376 #define GLUT_DEVICE_IGNORE_KEY_REPEAT 610
377 #define GLUT_DEVICE_KEY_REPEAT 611
378 #define GLUT_HAS_JOYSTICK 612
379 #define GLUT_OWNS_JOYSTICK 613
380 #define GLUT_JOYSTICK_BUTTONS 614
381 #define GLUT_JOYSTICK_AXES 615
382 #define GLUT_JOYSTICK_POLL_RATE 616
385 #if (GLUT_API_VERSION >= 3)
386 /* glutLayerGet parameters. */
387 #define GLUT_OVERLAY_POSSIBLE 800
388 #define GLUT_LAYER_IN_USE 801
389 #define GLUT_HAS_OVERLAY 802
390 #define GLUT_TRANSPARENT_INDEX 803
391 #define GLUT_NORMAL_DAMAGED 804
392 #define GLUT_OVERLAY_DAMAGED 805
394 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
395 /* glutVideoResizeGet parameters. */
396 #define GLUT_VIDEO_RESIZE_POSSIBLE 900
397 #define GLUT_VIDEO_RESIZE_IN_USE 901
398 #define GLUT_VIDEO_RESIZE_X_DELTA 902
399 #define GLUT_VIDEO_RESIZE_Y_DELTA 903
400 #define GLUT_VIDEO_RESIZE_WIDTH_DELTA 904
401 #define GLUT_VIDEO_RESIZE_HEIGHT_DELTA 905
402 #define GLUT_VIDEO_RESIZE_X 906
403 #define GLUT_VIDEO_RESIZE_Y 907
404 #define GLUT_VIDEO_RESIZE_WIDTH 908
405 #define GLUT_VIDEO_RESIZE_HEIGHT 909
408 /* glutUseLayer parameters. */
409 #define GLUT_NORMAL 0
410 #define GLUT_OVERLAY 1
412 /* glutGetModifiers return mask. */
413 #define GLUT_ACTIVE_SHIFT 1
414 #define GLUT_ACTIVE_CTRL 2
415 #define GLUT_ACTIVE_ALT 4
417 /* glutSetCursor parameters. */
419 #define GLUT_CURSOR_RIGHT_ARROW 0
420 #define GLUT_CURSOR_LEFT_ARROW 1
421 /* Symbolic cursor shapes. */
422 #define GLUT_CURSOR_INFO 2
423 #define GLUT_CURSOR_DESTROY 3
424 #define GLUT_CURSOR_HELP 4
425 #define GLUT_CURSOR_CYCLE 5
426 #define GLUT_CURSOR_SPRAY 6
427 #define GLUT_CURSOR_WAIT 7
428 #define GLUT_CURSOR_TEXT 8
429 #define GLUT_CURSOR_CROSSHAIR 9
430 /* Directional cursors. */
431 #define GLUT_CURSOR_UP_DOWN 10
432 #define GLUT_CURSOR_LEFT_RIGHT 11
433 /* Sizing cursors. */
434 #define GLUT_CURSOR_TOP_SIDE 12
435 #define GLUT_CURSOR_BOTTOM_SIDE 13
436 #define GLUT_CURSOR_LEFT_SIDE 14
437 #define GLUT_CURSOR_RIGHT_SIDE 15
438 #define GLUT_CURSOR_TOP_LEFT_CORNER 16
439 #define GLUT_CURSOR_TOP_RIGHT_CORNER 17
440 #define GLUT_CURSOR_BOTTOM_RIGHT_CORNER 18
441 #define GLUT_CURSOR_BOTTOM_LEFT_CORNER 19
442 /* Inherit from parent window. */
443 #define GLUT_CURSOR_INHERIT 100
445 #define GLUT_CURSOR_NONE 101
446 /* Fullscreen crosshair (if available). */
447 #define GLUT_CURSOR_FULL_CROSSHAIR 102
450 /* GLUT initialization sub-API. */
451 GLUTAPI
void GLUTAPIENTRY
glutInit(int *argcp
, char **argv
);
452 #if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
453 GLUTAPI
void GLUTAPIENTRY
__glutInitWithExit(int *argcp
, char **argv
, void (__cdecl
*exitfunc
)(int));
454 #ifndef GLUT_BUILDING_LIB
455 static void GLUTAPIENTRY
glutInit_ATEXIT_HACK(int *argcp
, char **argv
) { __glutInitWithExit(argcp
, argv
, exit
); }
456 #define glutInit glutInit_ATEXIT_HACK
459 GLUTAPI
void GLUTAPIENTRY
glutInitDisplayMode(unsigned int mode
);
460 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
461 GLUTAPI
void GLUTAPIENTRY
glutInitDisplayString(const char *string
);
463 GLUTAPI
void GLUTAPIENTRY
glutInitWindowPosition(int x
, int y
);
464 GLUTAPI
void GLUTAPIENTRY
glutInitWindowSize(int width
, int height
);
465 GLUTAPI
void GLUTAPIENTRY
glutMainLoop(void);
467 /* GLUT window sub-API. */
468 GLUTAPI
int GLUTAPIENTRY
glutCreateWindow(const char *title
);
469 #if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
470 GLUTAPI
int GLUTAPIENTRY
__glutCreateWindowWithExit(const char *title
, void (__cdecl
*exitfunc
)(int));
471 #ifndef GLUT_BUILDING_LIB
472 static int GLUTAPIENTRY
glutCreateWindow_ATEXIT_HACK(const char *title
) { return __glutCreateWindowWithExit(title
, exit
); }
473 #define glutCreateWindow glutCreateWindow_ATEXIT_HACK
476 GLUTAPI
int GLUTAPIENTRY
glutCreateSubWindow(int win
, int x
, int y
, int width
, int height
);
477 GLUTAPI
void GLUTAPIENTRY
glutDestroyWindow(int win
);
478 GLUTAPI
void GLUTAPIENTRY
glutPostRedisplay(void);
479 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
480 GLUTAPI
void GLUTAPIENTRY
glutPostWindowRedisplay(int win
);
482 GLUTAPI
void GLUTAPIENTRY
glutSwapBuffers(void);
483 GLUTAPI
int GLUTAPIENTRY
glutGetWindow(void);
484 GLUTAPI
void GLUTAPIENTRY
glutSetWindow(int win
);
485 GLUTAPI
void GLUTAPIENTRY
glutSetWindowTitle(const char *title
);
486 GLUTAPI
void GLUTAPIENTRY
glutSetIconTitle(const char *title
);
487 GLUTAPI
void GLUTAPIENTRY
glutPositionWindow(int x
, int y
);
488 GLUTAPI
void GLUTAPIENTRY
glutReshapeWindow(int width
, int height
);
489 GLUTAPI
void GLUTAPIENTRY
glutPopWindow(void);
490 GLUTAPI
void GLUTAPIENTRY
glutPushWindow(void);
491 GLUTAPI
void GLUTAPIENTRY
glutIconifyWindow(void);
492 GLUTAPI
void GLUTAPIENTRY
glutShowWindow(void);
493 GLUTAPI
void GLUTAPIENTRY
glutHideWindow(void);
494 #if (GLUT_API_VERSION >= 3)
495 GLUTAPI
void GLUTAPIENTRY
glutFullScreen(void);
496 GLUTAPI
void GLUTAPIENTRY
glutSetCursor(int cursor
);
497 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
498 GLUTAPI
void GLUTAPIENTRY
glutWarpPointer(int x
, int y
);
501 /* GLUT overlay sub-API. */
502 GLUTAPI
void GLUTAPIENTRY
glutEstablishOverlay(void);
503 GLUTAPI
void GLUTAPIENTRY
glutRemoveOverlay(void);
504 GLUTAPI
void GLUTAPIENTRY
glutUseLayer(GLenum layer
);
505 GLUTAPI
void GLUTAPIENTRY
glutPostOverlayRedisplay(void);
506 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
507 GLUTAPI
void GLUTAPIENTRY
glutPostWindowOverlayRedisplay(int win
);
509 GLUTAPI
void GLUTAPIENTRY
glutShowOverlay(void);
510 GLUTAPI
void GLUTAPIENTRY
glutHideOverlay(void);
513 /* GLUT menu sub-API. */
514 GLUTAPI
int GLUTAPIENTRY
glutCreateMenu(void (GLUTCALLBACK
*func
)(int));
515 #if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
516 GLUTAPI
int GLUTAPIENTRY
__glutCreateMenuWithExit(void (GLUTCALLBACK
*func
)(int), void (__cdecl
*exitfunc
)(int));
517 #ifndef GLUT_BUILDING_LIB
518 static int GLUTAPIENTRY
glutCreateMenu_ATEXIT_HACK(void (GLUTCALLBACK
*func
)(int)) { return __glutCreateMenuWithExit(func
, exit
); }
519 #define glutCreateMenu glutCreateMenu_ATEXIT_HACK
522 GLUTAPI
void GLUTAPIENTRY
glutDestroyMenu(int menu
);
523 GLUTAPI
int GLUTAPIENTRY
glutGetMenu(void);
524 GLUTAPI
void GLUTAPIENTRY
glutSetMenu(int menu
);
525 GLUTAPI
void GLUTAPIENTRY
glutAddMenuEntry(const char *label
, int value
);
526 GLUTAPI
void GLUTAPIENTRY
glutAddSubMenu(const char *label
, int submenu
);
527 GLUTAPI
void GLUTAPIENTRY
glutChangeToMenuEntry(int item
, const char *label
, int value
);
528 GLUTAPI
void GLUTAPIENTRY
glutChangeToSubMenu(int item
, const char *label
, int submenu
);
529 GLUTAPI
void GLUTAPIENTRY
glutRemoveMenuItem(int item
);
530 GLUTAPI
void GLUTAPIENTRY
glutAttachMenu(int button
);
531 GLUTAPI
void GLUTAPIENTRY
glutDetachMenu(int button
);
533 /* GLUT window callback sub-API. */
534 GLUTAPI
void GLUTAPIENTRY
glutDisplayFunc(void (GLUTCALLBACK
*func
)(void));
535 GLUTAPI
void GLUTAPIENTRY
glutReshapeFunc(void (GLUTCALLBACK
*func
)(int width
, int height
));
536 GLUTAPI
void GLUTAPIENTRY
glutKeyboardFunc(void (GLUTCALLBACK
*func
)(unsigned char key
, int x
, int y
));
537 GLUTAPI
void GLUTAPIENTRY
glutMouseFunc(void (GLUTCALLBACK
*func
)(int button
, int state
, int x
, int y
));
538 GLUTAPI
void GLUTAPIENTRY
glutMotionFunc(void (GLUTCALLBACK
*func
)(int x
, int y
));
539 GLUTAPI
void GLUTAPIENTRY
glutPassiveMotionFunc(void (GLUTCALLBACK
*func
)(int x
, int y
));
540 GLUTAPI
void GLUTAPIENTRY
glutEntryFunc(void (GLUTCALLBACK
*func
)(int state
));
541 GLUTAPI
void GLUTAPIENTRY
glutVisibilityFunc(void (GLUTCALLBACK
*func
)(int state
));
542 GLUTAPI
void GLUTAPIENTRY
glutIdleFunc(void (GLUTCALLBACK
*func
)(void));
543 GLUTAPI
void GLUTAPIENTRY
glutTimerFunc(unsigned int millis
, void (GLUTCALLBACK
*func
)(int value
), int value
);
544 GLUTAPI
void GLUTAPIENTRY
glutMenuStateFunc(void (GLUTCALLBACK
*func
)(int state
));
545 #if (GLUT_API_VERSION >= 2)
546 GLUTAPI
void GLUTAPIENTRY
glutSpecialFunc(void (GLUTCALLBACK
*func
)(int key
, int x
, int y
));
547 GLUTAPI
void GLUTAPIENTRY
glutSpaceballMotionFunc(void (GLUTCALLBACK
*func
)(int x
, int y
, int z
));
548 GLUTAPI
void GLUTAPIENTRY
glutSpaceballRotateFunc(void (GLUTCALLBACK
*func
)(int x
, int y
, int z
));
549 GLUTAPI
void GLUTAPIENTRY
glutSpaceballButtonFunc(void (GLUTCALLBACK
*func
)(int button
, int state
));
550 GLUTAPI
void GLUTAPIENTRY
glutButtonBoxFunc(void (GLUTCALLBACK
*func
)(int button
, int state
));
551 GLUTAPI
void GLUTAPIENTRY
glutDialsFunc(void (GLUTCALLBACK
*func
)(int dial
, int value
));
552 GLUTAPI
void GLUTAPIENTRY
glutTabletMotionFunc(void (GLUTCALLBACK
*func
)(int x
, int y
));
553 GLUTAPI
void GLUTAPIENTRY
glutTabletButtonFunc(void (GLUTCALLBACK
*func
)(int button
, int state
, int x
, int y
));
554 #if (GLUT_API_VERSION >= 3)
555 GLUTAPI
void GLUTAPIENTRY
glutMenuStatusFunc(void (GLUTCALLBACK
*func
)(int status
, int x
, int y
));
556 GLUTAPI
void GLUTAPIENTRY
glutOverlayDisplayFunc(void (GLUTCALLBACK
*func
)(void));
557 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
558 GLUTAPI
void GLUTAPIENTRY
glutWindowStatusFunc(void (GLUTCALLBACK
*func
)(int state
));
560 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
561 GLUTAPI
void GLUTAPIENTRY
glutKeyboardUpFunc(void (GLUTCALLBACK
*func
)(unsigned char key
, int x
, int y
));
562 GLUTAPI
void GLUTAPIENTRY
glutSpecialUpFunc(void (GLUTCALLBACK
*func
)(int key
, int x
, int y
));
563 GLUTAPI
void GLUTAPIENTRY
glutJoystickFunc(void (GLUTCALLBACK
*func
)(unsigned int buttonMask
, int x
, int y
, int z
), int pollInterval
);
568 /* GLUT color index sub-API. */
569 GLUTAPI
void GLUTAPIENTRY
glutSetColor(int ndx
, GLfloat red
, GLfloat green
, GLfloat blue
);
570 GLUTAPI GLfloat GLUTAPIENTRY
glutGetColor(int ndx
, int component
);
571 GLUTAPI
void GLUTAPIENTRY
glutCopyColormap(int win
);
573 /* GLUT state retrieval sub-API. */
574 GLUTAPI
int GLUTAPIENTRY
glutGet(GLenum type
);
575 GLUTAPI
int GLUTAPIENTRY
glutDeviceGet(GLenum type
);
576 #if (GLUT_API_VERSION >= 2)
577 /* GLUT extension support sub-API */
578 GLUTAPI
int GLUTAPIENTRY
glutExtensionSupported(const char *name
);
580 #if (GLUT_API_VERSION >= 3)
581 GLUTAPI
int GLUTAPIENTRY
glutGetModifiers(void);
582 GLUTAPI
int GLUTAPIENTRY
glutLayerGet(GLenum type
);
584 #if (GLUT_API_VERSION >= 5)
585 typedef void (*GLUTproc
)();
586 GLUTAPI GLUTproc GLUTAPIENTRY
glutGetProcAddress(const char *procName
);
589 /* GLUT font sub-API */
590 GLUTAPI
void GLUTAPIENTRY
glutBitmapCharacter(void *font
, int character
);
591 GLUTAPI
int GLUTAPIENTRY
glutBitmapWidth(void *font
, int character
);
592 GLUTAPI
void GLUTAPIENTRY
glutStrokeCharacter(void *font
, int character
);
593 GLUTAPI
int GLUTAPIENTRY
glutStrokeWidth(void *font
, int character
);
594 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
595 GLUTAPI
int GLUTAPIENTRY
glutBitmapLength(void *font
, const unsigned char *string
);
596 GLUTAPI
int GLUTAPIENTRY
glutStrokeLength(void *font
, const unsigned char *string
);
599 /* GLUT pre-built models sub-API */
600 GLUTAPI
void GLUTAPIENTRY
glutWireSphere(GLdouble radius
, GLint slices
, GLint stacks
);
601 GLUTAPI
void GLUTAPIENTRY
glutSolidSphere(GLdouble radius
, GLint slices
, GLint stacks
);
602 GLUTAPI
void GLUTAPIENTRY
glutWireCone(GLdouble base
, GLdouble height
, GLint slices
, GLint stacks
);
603 GLUTAPI
void GLUTAPIENTRY
glutSolidCone(GLdouble base
, GLdouble height
, GLint slices
, GLint stacks
);
604 GLUTAPI
void GLUTAPIENTRY
glutWireCube(GLdouble size
);
605 GLUTAPI
void GLUTAPIENTRY
glutSolidCube(GLdouble size
);
606 GLUTAPI
void GLUTAPIENTRY
glutWireTorus(GLdouble innerRadius
, GLdouble outerRadius
, GLint sides
, GLint rings
);
607 GLUTAPI
void GLUTAPIENTRY
glutSolidTorus(GLdouble innerRadius
, GLdouble outerRadius
, GLint sides
, GLint rings
);
608 GLUTAPI
void GLUTAPIENTRY
glutWireDodecahedron(void);
609 GLUTAPI
void GLUTAPIENTRY
glutSolidDodecahedron(void);
610 GLUTAPI
void GLUTAPIENTRY
glutWireTeapot(GLdouble size
);
611 GLUTAPI
void GLUTAPIENTRY
glutSolidTeapot(GLdouble size
);
612 GLUTAPI
void GLUTAPIENTRY
glutWireOctahedron(void);
613 GLUTAPI
void GLUTAPIENTRY
glutSolidOctahedron(void);
614 GLUTAPI
void GLUTAPIENTRY
glutWireTetrahedron(void);
615 GLUTAPI
void GLUTAPIENTRY
glutSolidTetrahedron(void);
616 GLUTAPI
void GLUTAPIENTRY
glutWireIcosahedron(void);
617 GLUTAPI
void GLUTAPIENTRY
glutSolidIcosahedron(void);
619 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
620 /* GLUT video resize sub-API. */
621 GLUTAPI
int GLUTAPIENTRY
glutVideoResizeGet(GLenum param
);
622 GLUTAPI
void GLUTAPIENTRY
glutSetupVideoResizing(void);
623 GLUTAPI
void GLUTAPIENTRY
glutStopVideoResizing(void);
624 GLUTAPI
void GLUTAPIENTRY
glutVideoResize(int x
, int y
, int width
, int height
);
625 GLUTAPI
void GLUTAPIENTRY
glutVideoPan(int x
, int y
, int width
, int height
);
627 /* GLUT debugging sub-API. */
628 GLUTAPI
void GLUTAPIENTRY
glutReportErrors(void);
631 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
632 /* GLUT device control sub-API. */
633 /* glutSetKeyRepeat modes. */
634 #define GLUT_KEY_REPEAT_OFF 0
635 #define GLUT_KEY_REPEAT_ON 1
636 #define GLUT_KEY_REPEAT_DEFAULT 2
638 /* Joystick button masks. */
639 #define GLUT_JOYSTICK_BUTTON_A 1
640 #define GLUT_JOYSTICK_BUTTON_B 2
641 #define GLUT_JOYSTICK_BUTTON_C 4
642 #define GLUT_JOYSTICK_BUTTON_D 8
644 GLUTAPI
void GLUTAPIENTRY
glutIgnoreKeyRepeat(int ignore
);
645 GLUTAPI
void GLUTAPIENTRY
glutSetKeyRepeat(int repeatMode
);
646 GLUTAPI
void GLUTAPIENTRY
glutForceJoystickFunc(void);
648 /* GLUT game mode sub-API. */
649 /* glutGameModeGet. */
650 #define GLUT_GAME_MODE_ACTIVE 0
651 #define GLUT_GAME_MODE_POSSIBLE 1
652 #define GLUT_GAME_MODE_WIDTH 2
653 #define GLUT_GAME_MODE_HEIGHT 3
654 #define GLUT_GAME_MODE_PIXEL_DEPTH 4
655 #define GLUT_GAME_MODE_REFRESH_RATE 5
656 #define GLUT_GAME_MODE_DISPLAY_CHANGED 6
658 GLUTAPI
void GLUTAPIENTRY
glutGameModeString(const char *string
);
659 GLUTAPI
int GLUTAPIENTRY
glutEnterGameMode(void);
660 GLUTAPI
void GLUTAPIENTRY
glutLeaveGameMode(void);
661 GLUTAPI
int GLUTAPIENTRY
glutGameModeGet(GLenum mode
);
668 #endif /* __glut_h__ */