vfs: check userland buffers before reading them.
[haiku.git] / headers / libs / glut / GL / glut.h
blobbe38791bf62c0622e153a60f5416795d5837a15c
1 /*
2 * Copyright 1994-1997 Mark Kilgard, All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * GPL licensing not permitted.
7 * Authors:
8 * Mark Kilgard
9 */
10 #ifndef __glut_h__
11 #define __glut_h__
14 #include <GL/gl.h>
15 #include <GL/glu.h>
18 #if defined(__MINGW32__)
19 #include <GL/mesa_wgl.h>
20 #endif
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
26 #if defined(_WIN32)
28 /* GLUT 3.7 now tries to avoid including <windows.h>
29 to avoid name space pollution, but Win32's <GL/gl.h>
30 needs APIENTRY and WINGDIAPI defined properly.
32 tjump@spgs.com contributes:
33 If users are building glut code on MS Windows, then they should
34 make sure they include windows.h early, let's not get into a
35 header definitions war since MS has proven it's capability to
36 change header dependencies w/o publishing they have done so.
38 So, let's not include windows.h here, as it's not really required and
39 MS own gl/gl.h *should* include it if the dependency is there. */
41 /* To disable automatic library usage for GLUT, define GLUT_NO_LIB_PRAGMA
42 in your compile preprocessor options. */
43 # if !defined(GLUT_BUILDING_LIB) && !defined(GLUT_NO_LIB_PRAGMA)
44 # pragma comment (lib, "winmm.lib") /* link with Windows MultiMedia lib */
45 /* To enable automatic SGI OpenGL for Windows library usage for GLUT,
46 define GLUT_USE_SGI_OPENGL in your compile preprocessor options. */
47 # ifdef GLUT_USE_SGI_OPENGL
48 # pragma comment (lib, "opengl.lib") /* link with SGI OpenGL for Windows lib */
49 # pragma comment (lib, "glu.lib") /* link with SGI OpenGL Utility lib */
50 # pragma comment (lib, "glut.lib") /* link with Win32 GLUT for SGI OpenGL lib */
51 # else
52 # pragma comment (lib, "opengl32.lib") /* link with Microsoft OpenGL lib */
53 # pragma comment (lib, "glu32.lib") /* link with Microsoft OpenGL Utility lib */
54 # pragma comment (lib, "glut32.lib") /* link with Win32 GLUT lib */
55 # endif
56 # endif
58 /* To disable supression of annoying warnings about floats being promoted
59 to doubles, define GLUT_NO_WARNING_DISABLE in your compile preprocessor
60 options. */
61 # ifndef GLUT_NO_WARNING_DISABLE
62 # pragma warning (disable:4244) /* Disable bogus VC++ 4.2 conversion warnings. */
63 # pragma warning (disable:4305) /* VC++ 5.0 version of above warning. */
64 # endif
66 /* Win32 has an annoying issue where there are multiple C run-time
67 libraries (CRTs). If the executable is linked with a different CRT
68 from the GLUT DLL, the GLUT DLL will not share the same CRT static
69 data seen by the executable. In particular, atexit callbacks registered
70 in the executable will not be called if GLUT calls its (different)
71 exit routine). GLUT is typically built with the
72 "/MD" option (the CRT with multithreading DLL support), but the Visual
73 C++ linker default is "/ML" (the single threaded CRT).
75 One workaround to this issue is requiring users to always link with
76 the same CRT as GLUT is compiled with. That requires users supply a
77 non-standard option. GLUT 3.7 has its own built-in workaround where
78 the executable's "exit" function pointer is covertly passed to GLUT.
79 GLUT then calls the executable's exit function pointer to ensure that
80 any "atexit" calls registered by the application are called if GLUT
81 needs to exit.
83 Note that the __glut*WithExit routines should NEVER be called directly.
84 To avoid the atexit workaround, #define GLUT_DISABLE_ATEXIT_HACK. */
86 /* XXX This is from Win32's <process.h> */
87 # if !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(__cdecl)
88 /* Define __cdecl for non-Microsoft compilers. */
89 # define __cdecl
90 # define GLUT_DEFINED___CDECL
91 # endif
92 # ifndef _CRTIMP
93 # ifdef _NTSDK
94 /* Definition compatible with NT SDK */
95 # define _CRTIMP
96 # else
97 /* Current definition */
98 # ifdef _DLL
99 # define _CRTIMP __declspec(dllimport)
100 # else
101 # define _CRTIMP
102 # endif
103 # endif
104 # define GLUT_DEFINED__CRTIMP
105 # endif
106 # ifndef GLUT_BUILDING_LIB
107 extern _CRTIMP void __cdecl exit(int);
108 # endif
110 /* GLUT callback calling convention for Win32. */
111 # define GLUTCALLBACK __cdecl
113 /* for callback/function pointer defs */
114 # define GLUTAPIENTRYV __cdecl
116 /* glut-win32 specific macros, defined to prevent collision with
117 and redifinition of Windows system defs, also removes requirement of
118 pretty much any standard windows header from this file */
120 #if (_MSC_VER >= 800) || defined(__MINGW32__) || defined(_STDCALL_SUPPORTED) || defined(__CYGWIN32__)
121 # define GLUTAPIENTRY __stdcall
122 #else
123 # define GLUTAPIENTRY
124 #endif
126 /* GLUT API entry point declarations for Win32. */
127 #if (defined(BUILD_GLUT32) || defined(GLUT_BUILDING_LIB)) && defined(_DLL)
128 # define GLUTAPI __declspec(dllexport)
129 #elif defined(_DLL)
130 # define GLUTAPI __declspec(dllimport)
131 #else
132 # define GLUTAPI extern
133 #endif
135 #if defined(_WIN32) && !defined(_WINDEF_) && !defined(MESA)
136 # if !defined(MESA_MINWARN)
137 # pragma message( "note: WINDOWS.H not included, providing Mesa definition of CALLBACK macro" )
138 # pragma message( "----: and PROC typedef. If you receive compiler warnings about either ")
139 # pragma message( "----: being multiply defined you should include WINDOWS.H priot to gl/glut.h" )
140 # endif
141 # define CALLBACK __stdcall
143 #if !defined(__MINGW32__)
144 typedef int (GLUTAPIENTRY *PROC)();
145 typedef void *HGLRC;
146 typedef void *HDC;
147 #endif
148 typedef unsigned long COLORREF;
149 #endif
151 #if defined(_WIN32) && !defined(_WINGDI_) && !defined(MESA)
152 # if !defined(MESA_MINWARN)
153 # pragma message( "note: WINDOWS.H not included, providing Mesa definition of wgl functions" )
154 # pragma message( "----: and macros. If you receive compiler warnings about any being multiply ")
155 # pragma message( "----: defined you should include WINDOWS.H priot to gl/glut.h" )
156 # endif
157 # define WGL_FONT_LINES 0
158 # define WGL_FONT_POLYGONS 1
159 # ifdef UNICODE
160 # define wglUseFontBitmaps wglUseFontBitmapsW
161 # define wglUseFontOutlines wglUseFontOutlinesW
162 # else
163 # define wglUseFontBitmaps wglUseFontBitmapsA
164 # define wglUseFontOutlines wglUseFontOutlinesA
165 # endif /* !UNICODE */
166 typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR;
167 typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT;
168 # pragma warning( push )
169 # pragma warning( disable : 4273 ) /* 'function' : inconsistent DLL linkage. dllexport assumed. */
170 # define WGLAPI __declspec(dllimport)
171 WGLAPI int GLAPIENTRY wglDeleteContext(HGLRC);
172 WGLAPI int GLAPIENTRY wglMakeCurrent(HDC,HGLRC);
173 WGLAPI int GLAPIENTRY wglSetPixelFormat(HDC, int, const PIXELFORMATDESCRIPTOR *);
174 WGLAPI int GLAPIENTRY wglSwapBuffers(HDC hdc);
175 WGLAPI HDC GLAPIENTRY wglGetCurrentDC(void);
176 WGLAPI HGLRC GLAPIENTRY wglCreateContext(HDC);
177 WGLAPI HGLRC GLAPIENTRY wglCreateLayerContext(HDC,int);
178 WGLAPI HGLRC GLAPIENTRY wglGetCurrentContext(void);
179 WGLAPI PROC GLAPIENTRY wglGetProcAddress(const char*);
180 WGLAPI int GLAPIENTRY wglChoosePixelFormat(HDC, const PIXELFORMATDESCRIPTOR *);
181 WGLAPI int GLAPIENTRY wglCopyContext(HGLRC, HGLRC, unsigned int);
182 WGLAPI int GLAPIENTRY wglDeleteContext(HGLRC);
183 WGLAPI int GLAPIENTRY wglDescribeLayerPlane(HDC, int, int, unsigned int,LPLAYERPLANEDESCRIPTOR);
184 WGLAPI int GLAPIENTRY wglDescribePixelFormat(HDC,int, unsigned int, LPPIXELFORMATDESCRIPTOR);
185 WGLAPI int GLAPIENTRY wglGetLayerPaletteEntries(HDC, int, int, int,COLORREF *);
186 WGLAPI int GLAPIENTRY wglGetPixelFormat(HDC hdc);
187 WGLAPI int GLAPIENTRY wglMakeCurrent(HDC, HGLRC);
188 WGLAPI int GLAPIENTRY wglRealizeLayerPalette(HDC, int, int);
189 WGLAPI int GLAPIENTRY wglSetLayerPaletteEntries(HDC, int, int, int,const COLORREF *);
190 WGLAPI int GLAPIENTRY wglShareLists(HGLRC, HGLRC);
191 WGLAPI int GLAPIENTRY wglSwapLayerBuffers(HDC, unsigned int);
192 WGLAPI int GLAPIENTRY wglUseFontBitmapsA(HDC, unsigned long, unsigned long, unsigned long);
193 WGLAPI int GLAPIENTRY wglUseFontBitmapsW(HDC, unsigned long, unsigned long, unsigned long);
194 WGLAPI int GLAPIENTRY wglUseFontOutlinesA(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
195 WGLAPI int GLAPIENTRY wglUseFontOutlinesW(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
196 WGLAPI int GLAPIENTRY SwapBuffers(HDC);
197 WGLAPI int GLAPIENTRY ChoosePixelFormat(HDC,const PIXELFORMATDESCRIPTOR *);
198 WGLAPI int GLAPIENTRY DescribePixelFormat(HDC,int,unsigned int,LPPIXELFORMATDESCRIPTOR);
199 WGLAPI int GLAPIENTRY GetPixelFormat(HDC);
200 WGLAPI int GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *);
201 # undef WGLAPI
202 # pragma warning( pop )
203 #endif
205 #else /* _WIN32 not defined */
207 /* Define GLUTAPIENTRY and GLUTCALLBACK to nothing if we aren't on Win32. */
208 # define GLUTAPIENTRY GLAPIENTRY
209 # define GLUTAPIENTRYV
210 # define GLUTCALLBACK
211 # define GLUTAPI extern
213 #endif
217 GLUT API revision history:
219 GLUT_API_VERSION is updated to reflect incompatible GLUT
220 API changes (interface changes, semantic changes, deletions,
221 or additions).
223 GLUT_API_VERSION=1 First public release of GLUT. 11/29/94
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.
229 GLUT_API_VERSION=3 glutMenuStatus added.
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!).
237 GLUT_API_VERSION=5 glutGetProcAddress (added by BrianP)
239 #ifndef GLUT_API_VERSION /* allow this to be overriden */
240 #define GLUT_API_VERSION 5
241 #endif
244 GLUT implementation revision history:
246 GLUT_XLIB_IMPLEMENTATION is updated to reflect both GLUT
247 API revisions and implementation revisions (ie, bug fixes).
249 GLUT_XLIB_IMPLEMENTATION=1 mjk's first public release of
250 GLUT Xlib-based implementation. 11/29/94
252 GLUT_XLIB_IMPLEMENTATION=2 mjk's second public release of
253 GLUT Xlib-based implementation providing GLUT version 2
254 interfaces.
256 GLUT_XLIB_IMPLEMENTATION=3 mjk's GLUT 2.2 images. 4/17/95
258 GLUT_XLIB_IMPLEMENTATION=4 mjk's GLUT 2.3 images. 6/?/95
260 GLUT_XLIB_IMPLEMENTATION=5 mjk's GLUT 3.0 images. 10/?/95
262 GLUT_XLIB_IMPLEMENTATION=7 mjk's GLUT 3.1+ with glutWarpPoitner. 7/24/96
264 GLUT_XLIB_IMPLEMENTATION=8 mjk's GLUT 3.1+ with glutWarpPoitner
265 and video resize. 1/3/97
267 GLUT_XLIB_IMPLEMENTATION=9 mjk's GLUT 3.4 release with early GLUT 4 routines.
269 GLUT_XLIB_IMPLEMENTATION=11 Mesa 2.5's GLUT 3.6 release.
271 GLUT_XLIB_IMPLEMENTATION=12 mjk's GLUT 3.6 release with early GLUT 4 routines + signal handling.
273 GLUT_XLIB_IMPLEMENTATION=13 mjk's GLUT 3.7 beta with GameGLUT support.
275 GLUT_XLIB_IMPLEMENTATION=14 mjk's GLUT 3.7 beta with f90gl friend interface.
277 GLUT_XLIB_IMPLEMENTATION=15 mjk's GLUT 3.7 beta sync'ed with Mesa <GL/glut.h>
279 #ifndef GLUT_XLIB_IMPLEMENTATION /* Allow this to be overriden. */
280 #define GLUT_XLIB_IMPLEMENTATION 15
281 #endif
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
301 /* Mouse buttons. */
302 #define GLUT_LEFT_BUTTON 0
303 #define GLUT_MIDDLE_BUTTON 1
304 #define GLUT_RIGHT_BUTTON 2
306 /* Mouse button state. */
307 #define GLUT_DOWN 0
308 #define GLUT_UP 1
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
336 /* Entry/exit state. */
337 #define GLUT_LEFT 0
338 #define GLUT_ENTERED 1
340 /* Menu usage state. */
341 #define GLUT_MENU_NOT_IN_USE 0
342 #define GLUT_MENU_IN_USE 1
344 /* Visibility state. */
345 #define GLUT_NOT_VISIBLE 0
346 #define GLUT_VISIBLE 1
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
354 /* Color index component selection values. */
355 #define GLUT_RED 0
356 #define GLUT_GREEN 1
357 #define GLUT_BLUE 2
359 /* Layers for use. */
360 #define GLUT_NORMAL 0
361 #define GLUT_OVERLAY 1
363 #if defined(_WIN32) || defined (GLUT_IMPORT_LIB)
364 /* Stroke font constants (use these in GLUT program). */
365 #define GLUT_STROKE_ROMAN ((void*)0)
366 #define GLUT_STROKE_MONO_ROMAN ((void*)1)
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). */
380 GLUTAPI void *glutStrokeRoman;
381 GLUTAPI void *glutStrokeMonoRoman;
383 /* Stroke font constants (use these in GLUT program). */
384 #define GLUT_STROKE_ROMAN (&glutStrokeRoman)
385 #define GLUT_STROKE_MONO_ROMAN (&glutStrokeMonoRoman)
387 /* Bitmap font opaque addresses (use constants instead in source code). */
388 GLUTAPI void *glutBitmap9By15;
389 GLUTAPI void *glutBitmap8By13;
390 GLUTAPI void *glutBitmapTimesRoman10;
391 GLUTAPI void *glutBitmapTimesRoman24;
392 GLUTAPI void *glutBitmapHelvetica10;
393 GLUTAPI void *glutBitmapHelvetica12;
394 GLUTAPI void *glutBitmapHelvetica18;
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
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
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
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
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
500 /* glutUseLayer parameters. */
501 #define GLUT_NORMAL 0
502 #define GLUT_OVERLAY 1
504 /* glutGetModifiers return mask. */
505 #define GLUT_ACTIVE_SHIFT 1
506 #define GLUT_ACTIVE_CTRL 2
507 #define GLUT_ACTIVE_ALT 4
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
542 /* GLUT initialization sub-API. */
543 GLUTAPI void GLUTAPIENTRY glutInit(int *argcp, char **argv);
544 #if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
545 GLUTAPI void GLUTAPIENTRY __glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int));
546 #ifndef GLUT_BUILDING_LIB
547 static void GLUTAPIENTRY glutInit_ATEXIT_HACK(int *argcp, char **argv) { __glutInitWithExit(argcp, argv, exit); }
548 #define glutInit glutInit_ATEXIT_HACK
549 #endif
550 #endif
551 GLUTAPI void GLUTAPIENTRY glutInitDisplayMode(unsigned int mode);
552 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
553 GLUTAPI void GLUTAPIENTRY glutInitDisplayString(const char *string);
554 #endif
555 GLUTAPI void GLUTAPIENTRY glutInitWindowPosition(int x, int y);
556 GLUTAPI void GLUTAPIENTRY glutInitWindowSize(int width, int height);
557 GLUTAPI void GLUTAPIENTRY glutMainLoop(void);
559 /* GLUT window sub-API. */
560 GLUTAPI int GLUTAPIENTRY glutCreateWindow(const char *title);
561 #if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
562 GLUTAPI int GLUTAPIENTRY __glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int));
563 #ifndef GLUT_BUILDING_LIB
564 static int GLUTAPIENTRY glutCreateWindow_ATEXIT_HACK(const char *title) { return __glutCreateWindowWithExit(title, exit); }
565 #define glutCreateWindow glutCreateWindow_ATEXIT_HACK
566 #endif
567 #endif
568 GLUTAPI int GLUTAPIENTRY glutCreateSubWindow(int win, int x, int y, int width, int height);
569 GLUTAPI void GLUTAPIENTRY glutDestroyWindow(int win);
570 GLUTAPI void GLUTAPIENTRY glutPostRedisplay(void);
571 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
572 GLUTAPI void GLUTAPIENTRY glutPostWindowRedisplay(int win);
573 #endif
574 GLUTAPI void GLUTAPIENTRY glutSwapBuffers(void);
575 GLUTAPI int GLUTAPIENTRY glutGetWindow(void);
576 GLUTAPI void GLUTAPIENTRY glutSetWindow(int win);
577 GLUTAPI void GLUTAPIENTRY glutSetWindowTitle(const char *title);
578 GLUTAPI void GLUTAPIENTRY glutSetIconTitle(const char *title);
579 GLUTAPI void GLUTAPIENTRY glutPositionWindow(int x, int y);
580 GLUTAPI void GLUTAPIENTRY glutReshapeWindow(int width, int height);
581 GLUTAPI void GLUTAPIENTRY glutPopWindow(void);
582 GLUTAPI void GLUTAPIENTRY glutPushWindow(void);
583 GLUTAPI void GLUTAPIENTRY glutIconifyWindow(void);
584 GLUTAPI void GLUTAPIENTRY glutShowWindow(void);
585 GLUTAPI void GLUTAPIENTRY glutHideWindow(void);
586 #if (GLUT_API_VERSION >= 3)
587 GLUTAPI void GLUTAPIENTRY glutFullScreen(void);
588 GLUTAPI void GLUTAPIENTRY glutSetCursor(int cursor);
589 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
590 GLUTAPI void GLUTAPIENTRY glutWarpPointer(int x, int y);
591 #endif
593 /* GLUT overlay sub-API. */
594 GLUTAPI void GLUTAPIENTRY glutEstablishOverlay(void);
595 GLUTAPI void GLUTAPIENTRY glutRemoveOverlay(void);
596 GLUTAPI void GLUTAPIENTRY glutUseLayer(GLenum layer);
597 GLUTAPI void GLUTAPIENTRY glutPostOverlayRedisplay(void);
598 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
599 GLUTAPI void GLUTAPIENTRY glutPostWindowOverlayRedisplay(int win);
600 #endif
601 GLUTAPI void GLUTAPIENTRY glutShowOverlay(void);
602 GLUTAPI void GLUTAPIENTRY glutHideOverlay(void);
603 #endif
605 /* GLUT menu sub-API. */
606 GLUTAPI int GLUTAPIENTRY glutCreateMenu(void (GLUTCALLBACK *func)(int));
607 #if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
608 GLUTAPI int GLUTAPIENTRY __glutCreateMenuWithExit(void (GLUTCALLBACK *func)(int), void (__cdecl *exitfunc)(int));
609 #ifndef GLUT_BUILDING_LIB
610 static int GLUTAPIENTRY glutCreateMenu_ATEXIT_HACK(void (GLUTCALLBACK *func)(int)) { return __glutCreateMenuWithExit(func, exit); }
611 #define glutCreateMenu glutCreateMenu_ATEXIT_HACK
612 #endif
613 #endif
614 GLUTAPI void GLUTAPIENTRY glutDestroyMenu(int menu);
615 GLUTAPI int GLUTAPIENTRY glutGetMenu(void);
616 GLUTAPI void GLUTAPIENTRY glutSetMenu(int menu);
617 GLUTAPI void GLUTAPIENTRY glutAddMenuEntry(const char *label, int value);
618 GLUTAPI void GLUTAPIENTRY glutAddSubMenu(const char *label, int submenu);
619 GLUTAPI void GLUTAPIENTRY glutChangeToMenuEntry(int item, const char *label, int value);
620 GLUTAPI void GLUTAPIENTRY glutChangeToSubMenu(int item, const char *label, int submenu);
621 GLUTAPI void GLUTAPIENTRY glutRemoveMenuItem(int item);
622 GLUTAPI void GLUTAPIENTRY glutAttachMenu(int button);
623 GLUTAPI void GLUTAPIENTRY glutDetachMenu(int button);
625 /* GLUT window callback sub-API. */
626 GLUTAPI void GLUTAPIENTRY glutDisplayFunc(void (GLUTCALLBACK *func)(void));
627 GLUTAPI void GLUTAPIENTRY glutReshapeFunc(void (GLUTCALLBACK *func)(int width, int height));
628 GLUTAPI void GLUTAPIENTRY glutKeyboardFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y));
629 GLUTAPI void GLUTAPIENTRY glutMouseFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y));
630 GLUTAPI void GLUTAPIENTRY glutMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
631 GLUTAPI void GLUTAPIENTRY glutPassiveMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
632 GLUTAPI void GLUTAPIENTRY glutEntryFunc(void (GLUTCALLBACK *func)(int state));
633 GLUTAPI void GLUTAPIENTRY glutVisibilityFunc(void (GLUTCALLBACK *func)(int state));
634 GLUTAPI void GLUTAPIENTRY glutIdleFunc(void (GLUTCALLBACK *func)(void));
635 GLUTAPI void GLUTAPIENTRY glutTimerFunc(unsigned int millis, void (GLUTCALLBACK *func)(int value), int value);
636 GLUTAPI void GLUTAPIENTRY glutMenuStateFunc(void (GLUTCALLBACK *func)(int state));
637 #if (GLUT_API_VERSION >= 2)
638 GLUTAPI void GLUTAPIENTRY glutSpecialFunc(void (GLUTCALLBACK *func)(int key, int x, int y));
639 GLUTAPI void GLUTAPIENTRY glutSpaceballMotionFunc(void (GLUTCALLBACK *func)(int x, int y, int z));
640 GLUTAPI void GLUTAPIENTRY glutSpaceballRotateFunc(void (GLUTCALLBACK *func)(int x, int y, int z));
641 GLUTAPI void GLUTAPIENTRY glutSpaceballButtonFunc(void (GLUTCALLBACK *func)(int button, int state));
642 GLUTAPI void GLUTAPIENTRY glutButtonBoxFunc(void (GLUTCALLBACK *func)(int button, int state));
643 GLUTAPI void GLUTAPIENTRY glutDialsFunc(void (GLUTCALLBACK *func)(int dial, int value));
644 GLUTAPI void GLUTAPIENTRY glutTabletMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
645 GLUTAPI void GLUTAPIENTRY glutTabletButtonFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y));
646 #if (GLUT_API_VERSION >= 3)
647 GLUTAPI void GLUTAPIENTRY glutMenuStatusFunc(void (GLUTCALLBACK *func)(int status, int x, int y));
648 GLUTAPI void GLUTAPIENTRY glutOverlayDisplayFunc(void (GLUTCALLBACK *func)(void));
649 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
650 GLUTAPI void GLUTAPIENTRY glutWindowStatusFunc(void (GLUTCALLBACK *func)(int state));
651 #endif
652 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
653 GLUTAPI void GLUTAPIENTRY glutKeyboardUpFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y));
654 GLUTAPI void GLUTAPIENTRY glutSpecialUpFunc(void (GLUTCALLBACK *func)(int key, int x, int y));
655 GLUTAPI void GLUTAPIENTRY glutJoystickFunc(void (GLUTCALLBACK *func)(unsigned int buttonMask, int x, int y, int z), int pollInterval);
656 #endif
657 #endif
658 #endif
660 /* GLUT color index sub-API. */
661 GLUTAPI void GLUTAPIENTRY glutSetColor(int ndx, GLfloat red, GLfloat green, GLfloat blue);
662 GLUTAPI GLfloat GLUTAPIENTRY glutGetColor(int ndx, int component);
663 GLUTAPI void GLUTAPIENTRY glutCopyColormap(int win);
665 /* GLUT state retrieval sub-API. */
666 GLUTAPI int GLUTAPIENTRY glutGet(GLenum type);
667 GLUTAPI int GLUTAPIENTRY glutDeviceGet(GLenum type);
668 #if (GLUT_API_VERSION >= 2)
669 /* GLUT extension support sub-API */
670 GLUTAPI int GLUTAPIENTRY glutExtensionSupported(const char *name);
671 #endif
672 #if (GLUT_API_VERSION >= 3)
673 GLUTAPI int GLUTAPIENTRY glutGetModifiers(void);
674 GLUTAPI int GLUTAPIENTRY glutLayerGet(GLenum type);
675 #endif
676 #if (GLUT_API_VERSION >= 5)
677 typedef void (*GLUTproc)();
678 GLUTAPI GLUTproc GLUTAPIENTRY glutGetProcAddress(const char *procName);
679 #endif
681 /* GLUT font sub-API */
682 GLUTAPI void GLUTAPIENTRY glutBitmapCharacter(void *font, int character);
683 GLUTAPI int GLUTAPIENTRY glutBitmapWidth(void *font, int character);
684 GLUTAPI void GLUTAPIENTRY glutStrokeCharacter(void *font, int character);
685 GLUTAPI int GLUTAPIENTRY glutStrokeWidth(void *font, int character);
686 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
687 GLUTAPI int GLUTAPIENTRY glutBitmapLength(void *font, const unsigned char *string);
688 GLUTAPI int GLUTAPIENTRY glutStrokeLength(void *font, const unsigned char *string);
689 #endif
691 /* GLUT pre-built models sub-API */
692 GLUTAPI void GLUTAPIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks);
693 GLUTAPI void GLUTAPIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks);
694 GLUTAPI void GLUTAPIENTRY glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
695 GLUTAPI void GLUTAPIENTRY glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
696 GLUTAPI void GLUTAPIENTRY glutWireCube(GLdouble size);
697 GLUTAPI void GLUTAPIENTRY glutSolidCube(GLdouble size);
698 GLUTAPI void GLUTAPIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
699 GLUTAPI void GLUTAPIENTRY glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
700 GLUTAPI void GLUTAPIENTRY glutWireDodecahedron(void);
701 GLUTAPI void GLUTAPIENTRY glutSolidDodecahedron(void);
702 GLUTAPI void GLUTAPIENTRY glutWireTeapot(GLdouble size);
703 GLUTAPI void GLUTAPIENTRY glutSolidTeapot(GLdouble size);
704 GLUTAPI void GLUTAPIENTRY glutWireOctahedron(void);
705 GLUTAPI void GLUTAPIENTRY glutSolidOctahedron(void);
706 GLUTAPI void GLUTAPIENTRY glutWireTetrahedron(void);
707 GLUTAPI void GLUTAPIENTRY glutSolidTetrahedron(void);
708 GLUTAPI void GLUTAPIENTRY glutWireIcosahedron(void);
709 GLUTAPI void GLUTAPIENTRY glutSolidIcosahedron(void);
711 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
712 /* GLUT video resize sub-API. */
713 GLUTAPI int GLUTAPIENTRY glutVideoResizeGet(GLenum param);
714 GLUTAPI void GLUTAPIENTRY glutSetupVideoResizing(void);
715 GLUTAPI void GLUTAPIENTRY glutStopVideoResizing(void);
716 GLUTAPI void GLUTAPIENTRY glutVideoResize(int x, int y, int width, int height);
717 GLUTAPI void GLUTAPIENTRY glutVideoPan(int x, int y, int width, int height);
719 /* GLUT debugging sub-API. */
720 GLUTAPI void GLUTAPIENTRY glutReportErrors(void);
721 #endif
723 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
724 /* GLUT device control sub-API. */
725 /* glutSetKeyRepeat modes. */
726 #define GLUT_KEY_REPEAT_OFF 0
727 #define GLUT_KEY_REPEAT_ON 1
728 #define GLUT_KEY_REPEAT_DEFAULT 2
730 /* Joystick button masks. */
731 #define GLUT_JOYSTICK_BUTTON_A 1
732 #define GLUT_JOYSTICK_BUTTON_B 2
733 #define GLUT_JOYSTICK_BUTTON_C 4
734 #define GLUT_JOYSTICK_BUTTON_D 8
736 GLUTAPI void GLUTAPIENTRY glutIgnoreKeyRepeat(int ignore);
737 GLUTAPI void GLUTAPIENTRY glutSetKeyRepeat(int repeatMode);
738 GLUTAPI void GLUTAPIENTRY glutForceJoystickFunc(void);
740 /* GLUT game mode sub-API. */
741 /* glutGameModeGet. */
742 #define GLUT_GAME_MODE_ACTIVE 0
743 #define GLUT_GAME_MODE_POSSIBLE 1
744 #define GLUT_GAME_MODE_WIDTH 2
745 #define GLUT_GAME_MODE_HEIGHT 3
746 #define GLUT_GAME_MODE_PIXEL_DEPTH 4
747 #define GLUT_GAME_MODE_REFRESH_RATE 5
748 #define GLUT_GAME_MODE_DISPLAY_CHANGED 6
750 GLUTAPI void GLUTAPIENTRY glutGameModeString(const char *string);
751 GLUTAPI int GLUTAPIENTRY glutEnterGameMode(void);
752 GLUTAPI void GLUTAPIENTRY glutLeaveGameMode(void);
753 GLUTAPI int GLUTAPIENTRY glutGameModeGet(GLenum mode);
754 #endif
756 #ifdef __cplusplus
758 #endif
761 #endif /* __glut_h__ */