Main Page | Namespace List | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

glut.h

Go to the documentation of this file.
00001 #ifndef __glut_h__
00002 #define __glut_h__
00003 
00004 /* Copyright (c) Mark J. Kilgard, 1994, 1995, 1996, 1998. */
00005 
00006 /* This program is freely distributable without licensing fees  and is
00007    provided without guarantee or warrantee expressed or  implied. This
00008    program is -not- in the public domain. */
00009 
00010 #include <GL/gl.h>
00011 #include <GL/glu.h>
00012 
00013 #ifdef __cplusplus
00014 extern "C" {
00015 #endif
00016 
00017 #if defined(_WIN32)
00018 
00019 /* GLUT 3.7 now tries to avoid including <windows.h>
00020    to avoid name space pollution, but Win32's <GL/gl.h>
00021    needs APIENTRY and WINGDIAPI defined properly.
00022 
00023    tjump@spgs.com contributes:
00024    If users are building glut code on MS Windows, then they should
00025    make sure they include windows.h early, let's not get into a
00026    header definitions war since MS has proven it's capability to
00027    change header dependencies w/o publishing they have done so.
00028 
00029    So, let's not include windows.h here, as it's not really required and
00030    MS own gl/gl.h *should* include it if the dependency is there. */
00031 
00032 /* To disable automatic library usage for GLUT, define GLUT_NO_LIB_PRAGMA
00033    in your compile preprocessor options. */
00034 # if !defined(GLUT_BUILDING_LIB) && !defined(GLUT_NO_LIB_PRAGMA)
00035 #  pragma comment (lib, "winmm.lib")      /* link with Windows MultiMedia lib */
00036 /* To enable automatic SGI OpenGL for Windows library usage for GLUT,
00037    define GLUT_USE_SGI_OPENGL in your compile preprocessor options.  */
00038 #  ifdef GLUT_USE_SGI_OPENGL
00039 #   pragma comment (lib, "opengl.lib")    /* link with SGI OpenGL for Windows lib */
00040 #   pragma comment (lib, "glu.lib")       /* link with SGI OpenGL Utility lib */
00041 #   pragma comment (lib, "glut.lib")      /* link with Win32 GLUT for SGI OpenGL lib */
00042 #  else
00043 #   pragma comment (lib, "opengl32.lib")  /* link with Microsoft OpenGL lib */
00044 #   pragma comment (lib, "glu32.lib")     /* link with Microsoft OpenGL Utility lib */
00045 #   pragma comment (lib, "glut32.lib")    /* link with Win32 GLUT lib */
00046 #  endif
00047 # endif
00048 
00049 /* To disable supression of annoying warnings about floats being promoted
00050    to doubles, define GLUT_NO_WARNING_DISABLE in your compile preprocessor
00051    options. */
00052 # ifndef GLUT_NO_WARNING_DISABLE
00053 #  pragma warning (disable:4244)  /* Disable bogus VC++ 4.2 conversion warnings. */
00054 #  pragma warning (disable:4305)  /* VC++ 5.0 version of above warning. */
00055 # endif
00056 
00057 /* Win32 has an annoying issue where there are multiple C run-time
00058    libraries (CRTs).  If the executable is linked with a different CRT
00059    from the GLUT DLL, the GLUT DLL will not share the same CRT static
00060    data seen by the executable.  In particular, atexit callbacks registered
00061    in the executable will not be called if GLUT calls its (different)
00062    exit routine).  GLUT is typically built with the
00063    "/MD" option (the CRT with multithreading DLL support), but the Visual
00064    C++ linker default is "/ML" (the single threaded CRT).
00065 
00066    One workaround to this issue is requiring users to always link with
00067    the same CRT as GLUT is compiled with.  That requires users supply a
00068    non-standard option.  GLUT 3.7 has its own built-in workaround where
00069    the executable's "exit" function pointer is covertly passed to GLUT.
00070    GLUT then calls the executable's exit function pointer to ensure that
00071    any "atexit" calls registered by the application are called if GLUT
00072    needs to exit.
00073 
00074    Note that the __glut*WithExit routines should NEVER be called directly.
00075    To avoid the atexit workaround, #define GLUT_DISABLE_ATEXIT_HACK. */
00076 
00077 /* XXX This is from Win32's <process.h> */
00078 # if !defined(_MSC_VER) && !defined(__cdecl)
00079    /* Define __cdecl for non-Microsoft compilers. */
00080 #  define __cdecl
00081 #  define GLUT_DEFINED___CDECL
00082 # endif
00083 # ifndef _CRTIMP
00084 #  ifdef _NTSDK
00085     /* Definition compatible with NT SDK */
00086 #   define _CRTIMP
00087 #  else
00088     /* Current definition */
00089 #   ifdef _DLL
00090 #    define _CRTIMP __declspec(dllimport)
00091 #   else
00092 #    define _CRTIMP
00093 #   endif
00094 #  endif
00095 #  define GLUT_DEFINED__CRTIMP
00096 # endif
00097 # ifndef GLUT_BUILDING_LIB
00098 extern _CRTIMP void __cdecl exit(int);
00099 # endif
00100 
00101 /* GLUT callback calling convention for Win32. */
00102 # define GLUTCALLBACK __cdecl
00103 
00104 /* for callback/function pointer defs */
00105 # define GLUTAPIENTRYV __cdecl
00106 
00107 /* glut-win32 specific macros, defined to prevent collision with
00108    and redifinition of Windows system defs, also removes requirement of
00109    pretty much any standard windows header from this file */
00110 
00111 #if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__CYGWIN32__)
00112 #   define GLUTAPIENTRY __stdcall
00113 #else
00114 #   define GLUTAPIENTRY
00115 #endif
00116 
00117 /* GLUT API entry point declarations for Win32. */
00118 #if defined(GLUT_BUILDING_LIB) && defined(_DLL)
00119 #   define GLUTAPI __declspec(dllexport)
00120 #elif defined(_DLL)
00121 #   define GLUTAPI __declspec(dllimport)
00122 #else
00123 #   define GLUTAPI extern
00124 #endif
00125 
00126 #if defined(_WIN32) && !defined(_WINDEF_) && !defined(MESA)
00127 #   if !defined(MESA_MINWARN)
00128 #       pragma message( "note: WINDOWS.H not included, providing Mesa definition of CALLBACK macro" )
00129 #       pragma message( "----: and PROC typedef. If you receive compiler warnings about either ")
00130 #       pragma message( "----: being multiply defined you should include WINDOWS.H priot to gl/glut.h" )
00131 #   endif
00132 #   define CALLBACK __stdcall
00133 typedef int (GLUTAPIENTRY *PROC)();
00134 typedef void *HGLRC;
00135 typedef void *HDC;
00136 typedef unsigned long COLORREF;
00137 #endif
00138 
00139 #if defined(_WIN32) && !defined(_WINGDI_) && !defined(MESA)
00140 #   if !defined(MESA_MINWARN)
00141 #       pragma message( "note: WINDOWS.H not included, providing Mesa definition of wgl functions" )
00142 #       pragma message( "----: and macros. If you receive compiler warnings about any being multiply ")
00143 #       pragma message( "----: defined you should include WINDOWS.H priot to gl/glut.h" )
00144 #   endif
00145 #   define WGL_FONT_LINES      0
00146 #   define WGL_FONT_POLYGONS   1
00147 #   ifdef UNICODE
00148 #       define wglUseFontBitmaps  wglUseFontBitmapsW
00149 #       define wglUseFontOutlines  wglUseFontOutlinesW
00150 #   else
00151 #       define wglUseFontBitmaps  wglUseFontBitmapsA
00152 #       define wglUseFontOutlines  wglUseFontOutlinesA
00153 #   endif /* !UNICODE */
00154 typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR;
00155 typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT;
00156 #  pragma warning( push )
00157 #  pragma warning( disable : 4273 ) /* 'function' : inconsistent DLL linkage. dllexport assumed. */
00158 #  define WGLAPI __declspec(dllimport)
00159 WGLAPI int   GLAPIENTRY wglDeleteContext(HGLRC);
00160 WGLAPI int   GLAPIENTRY wglMakeCurrent(HDC,HGLRC);
00161 WGLAPI int   GLAPIENTRY wglSetPixelFormat(HDC, int, const PIXELFORMATDESCRIPTOR *);
00162 WGLAPI int   GLAPIENTRY wglSwapBuffers(HDC hdc);
00163 WGLAPI HDC   GLAPIENTRY wglGetCurrentDC(void);
00164 WGLAPI HGLRC GLAPIENTRY wglCreateContext(HDC);
00165 WGLAPI HGLRC GLAPIENTRY wglCreateLayerContext(HDC,int);
00166 WGLAPI HGLRC GLAPIENTRY wglGetCurrentContext(void);
00167 WGLAPI PROC  GLAPIENTRY wglGetProcAddress(const char*);
00168 WGLAPI int   GLAPIENTRY wglChoosePixelFormat(HDC, const PIXELFORMATDESCRIPTOR *);
00169 WGLAPI int   GLAPIENTRY wglCopyContext(HGLRC, HGLRC, unsigned int);
00170 WGLAPI int   GLAPIENTRY wglDeleteContext(HGLRC);
00171 WGLAPI int   GLAPIENTRY wglDescribeLayerPlane(HDC, int, int, unsigned int,LPLAYERPLANEDESCRIPTOR);
00172 WGLAPI int   GLAPIENTRY wglDescribePixelFormat(HDC,int, unsigned int, LPPIXELFORMATDESCRIPTOR);
00173 WGLAPI int   GLAPIENTRY wglGetLayerPaletteEntries(HDC, int, int, int,COLORREF *);
00174 WGLAPI int   GLAPIENTRY wglGetPixelFormat(HDC hdc);
00175 WGLAPI int   GLAPIENTRY wglMakeCurrent(HDC, HGLRC);
00176 WGLAPI int   GLAPIENTRY wglRealizeLayerPalette(HDC, int, int);
00177 WGLAPI int   GLAPIENTRY wglSetLayerPaletteEntries(HDC, int, int, int,const COLORREF *);
00178 WGLAPI int   GLAPIENTRY wglShareLists(HGLRC, HGLRC);
00179 WGLAPI int   GLAPIENTRY wglSwapLayerBuffers(HDC, unsigned int);
00180 WGLAPI int   GLAPIENTRY wglUseFontBitmapsA(HDC, unsigned long, unsigned long, unsigned long);
00181 WGLAPI int   GLAPIENTRY wglUseFontBitmapsW(HDC, unsigned long, unsigned long, unsigned long);
00182 WGLAPI int   GLAPIENTRY wglUseFontOutlinesA(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
00183 WGLAPI int   GLAPIENTRY wglUseFontOutlinesW(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
00184 WGLAPI int   GLAPIENTRY SwapBuffers(HDC);
00185 WGLAPI int   GLAPIENTRY ChoosePixelFormat(HDC,const PIXELFORMATDESCRIPTOR *);
00186 WGLAPI int   GLAPIENTRY DescribePixelFormat(HDC,int,unsigned int,LPPIXELFORMATDESCRIPTOR);
00187 WGLAPI int   GLAPIENTRY GetPixelFormat(HDC);
00188 WGLAPI int   GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *);
00189 #  undef WGLAPI
00190 #  pragma warning( pop )
00191 #endif
00192 
00193 #else /* _WIN32 not defined */
00194 
00195 /* Define GLUTAPIENTRY and GLUTCALLBACK to nothing if we aren't on Win32. */
00196 #  define GLUTAPIENTRY
00197 #  define GLUTAPIENTRYV
00198 #  define GLUT_APIENTRY_DEFINED
00199 #  define GLUTCALLBACK
00200 #  define GLUTAPI extern
00201 /* Prototype exit for the non-Win32 case (see above). */
00202 /*extern void exit(int);  this screws up gcc -ansi -pedantic! */
00203 #endif
00204 
00205 
00229 #ifndef GLUT_API_VERSION  /* allow this to be overriden */
00230 #define GLUT_API_VERSION        5
00231 #endif
00232 
00269 #ifndef GLUT_XLIB_IMPLEMENTATION  /* Allow this to be overriden. */
00270 #define GLUT_XLIB_IMPLEMENTATION    15
00271 #endif
00272 
00273 /* Display mode bit masks. */
00274 #define GLUT_RGB            0
00275 #define GLUT_RGBA           GLUT_RGB
00276 #define GLUT_INDEX          1
00277 #define GLUT_SINGLE         0
00278 #define GLUT_DOUBLE         2
00279 #define GLUT_ACCUM          4
00280 #define GLUT_ALPHA          8
00281 #define GLUT_DEPTH          16
00282 #define GLUT_STENCIL            32
00283 #if (GLUT_API_VERSION >= 2)
00284 #define GLUT_MULTISAMPLE        128
00285 #define GLUT_STEREO         256
00286 #endif
00287 #if (GLUT_API_VERSION >= 3)
00288 #define GLUT_LUMINANCE          512
00289 #endif
00290 
00291 /* Mouse buttons. */
00292 #define GLUT_LEFT_BUTTON        0
00293 #define GLUT_MIDDLE_BUTTON      1
00294 #define GLUT_RIGHT_BUTTON       2
00295 
00296 /* Mouse button  state. */
00297 #define GLUT_DOWN           0
00298 #define GLUT_UP             1
00299 
00300 #if (GLUT_API_VERSION >= 2)
00301 /* function keys */
00302 #define GLUT_KEY_F1         1
00303 #define GLUT_KEY_F2         2
00304 #define GLUT_KEY_F3         3
00305 #define GLUT_KEY_F4         4
00306 #define GLUT_KEY_F5         5
00307 #define GLUT_KEY_F6         6
00308 #define GLUT_KEY_F7         7
00309 #define GLUT_KEY_F8         8
00310 #define GLUT_KEY_F9         9
00311 #define GLUT_KEY_F10            10
00312 #define GLUT_KEY_F11            11
00313 #define GLUT_KEY_F12            12
00314 /* directional keys */
00315 #define GLUT_KEY_LEFT           100
00316 #define GLUT_KEY_UP         101
00317 #define GLUT_KEY_RIGHT          102
00318 #define GLUT_KEY_DOWN           103
00319 #define GLUT_KEY_PAGE_UP        104
00320 #define GLUT_KEY_PAGE_DOWN      105
00321 #define GLUT_KEY_HOME           106
00322 #define GLUT_KEY_END            107
00323 #define GLUT_KEY_INSERT         108
00324 #endif
00325 
00326 /* Entry/exit  state. */
00327 #define GLUT_LEFT           0
00328 #define GLUT_ENTERED            1
00329 
00330 /* Menu usage  state. */
00331 #define GLUT_MENU_NOT_IN_USE        0
00332 #define GLUT_MENU_IN_USE        1
00333 
00334 /* Visibility  state. */
00335 #define GLUT_NOT_VISIBLE        0
00336 #define GLUT_VISIBLE            1
00337 
00338 /* Window status  state. */
00339 #define GLUT_HIDDEN         0
00340 #define GLUT_FULLY_RETAINED     1
00341 #define GLUT_PARTIALLY_RETAINED     2
00342 #define GLUT_FULLY_COVERED      3
00343 
00344 /* Color index component selection values. */
00345 #define GLUT_RED            0
00346 #define GLUT_GREEN          1
00347 #define GLUT_BLUE           2
00348 
00349 /* Layers for use. */
00350 #define GLUT_NORMAL         0
00351 #define GLUT_OVERLAY            1
00352 
00353 #if defined(_WIN32)
00354 /* Stroke font constants (use these in GLUT program). */
00355 #define GLUT_STROKE_ROMAN       ((void*)0)
00356 #define GLUT_STROKE_MONO_ROMAN      ((void*)1)
00357 
00358 /* Bitmap font constants (use these in GLUT program). */
00359 #define GLUT_BITMAP_9_BY_15     ((void*)2)
00360 #define GLUT_BITMAP_8_BY_13     ((void*)3)
00361 #define GLUT_BITMAP_TIMES_ROMAN_10  ((void*)4)
00362 #define GLUT_BITMAP_TIMES_ROMAN_24  ((void*)5)
00363 #if (GLUT_API_VERSION >= 3)
00364 #define GLUT_BITMAP_HELVETICA_10    ((void*)6)
00365 #define GLUT_BITMAP_HELVETICA_12    ((void*)7)
00366 #define GLUT_BITMAP_HELVETICA_18    ((void*)8)
00367 #endif
00368 #else
00369 /* Stroke font opaque addresses (use constants instead in source code). */
00370 GLUTAPI void *glutStrokeRoman;
00371 GLUTAPI void *glutStrokeMonoRoman;
00372 
00373 /* Stroke font constants (use these in GLUT program). */
00374 #define GLUT_STROKE_ROMAN       (&glutStrokeRoman)
00375 #define GLUT_STROKE_MONO_ROMAN      (&glutStrokeMonoRoman)
00376 
00377 /* Bitmap font opaque addresses (use constants instead in source code). */
00378 GLUTAPI void *glutBitmap9By15;
00379 GLUTAPI void *glutBitmap8By13;
00380 GLUTAPI void *glutBitmapTimesRoman10;
00381 GLUTAPI void *glutBitmapTimesRoman24;
00382 GLUTAPI void *glutBitmapHelvetica10;
00383 GLUTAPI void *glutBitmapHelvetica12;
00384 GLUTAPI void *glutBitmapHelvetica18;
00385 
00386 /* Bitmap font constants (use these in GLUT program). */
00387 #define GLUT_BITMAP_9_BY_15     (&glutBitmap9By15)
00388 #define GLUT_BITMAP_8_BY_13     (&glutBitmap8By13)
00389 #define GLUT_BITMAP_TIMES_ROMAN_10  (&glutBitmapTimesRoman10)
00390 #define GLUT_BITMAP_TIMES_ROMAN_24  (&glutBitmapTimesRoman24)
00391 #if (GLUT_API_VERSION >= 3)
00392 #define GLUT_BITMAP_HELVETICA_10    (&glutBitmapHelvetica10)
00393 #define GLUT_BITMAP_HELVETICA_12    (&glutBitmapHelvetica12)
00394 #define GLUT_BITMAP_HELVETICA_18    (&glutBitmapHelvetica18)
00395 #endif
00396 #endif
00397 
00398 /* glutGet parameters. */
00399 #define GLUT_WINDOW_X           100
00400 #define GLUT_WINDOW_Y           101
00401 #define GLUT_WINDOW_WIDTH       102
00402 #define GLUT_WINDOW_HEIGHT      103
00403 #define GLUT_WINDOW_BUFFER_SIZE     104
00404 #define GLUT_WINDOW_STENCIL_SIZE    105
00405 #define GLUT_WINDOW_DEPTH_SIZE      106
00406 #define GLUT_WINDOW_RED_SIZE        107
00407 #define GLUT_WINDOW_GREEN_SIZE      108
00408 #define GLUT_WINDOW_BLUE_SIZE       109
00409 #define GLUT_WINDOW_ALPHA_SIZE      110
00410 #define GLUT_WINDOW_ACCUM_RED_SIZE  111
00411 #define GLUT_WINDOW_ACCUM_GREEN_SIZE    112
00412 #define GLUT_WINDOW_ACCUM_BLUE_SIZE 113
00413 #define GLUT_WINDOW_ACCUM_ALPHA_SIZE    114
00414 #define GLUT_WINDOW_DOUBLEBUFFER    115
00415 #define GLUT_WINDOW_RGBA        116
00416 #define GLUT_WINDOW_PARENT      117
00417 #define GLUT_WINDOW_NUM_CHILDREN    118
00418 #define GLUT_WINDOW_COLORMAP_SIZE   119
00419 #if (GLUT_API_VERSION >= 2)
00420 #define GLUT_WINDOW_NUM_SAMPLES     120
00421 #define GLUT_WINDOW_STEREO      121
00422 #endif
00423 #if (GLUT_API_VERSION >= 3)
00424 #define GLUT_WINDOW_CURSOR      122
00425 #endif
00426 #define GLUT_SCREEN_WIDTH       200
00427 #define GLUT_SCREEN_HEIGHT      201
00428 #define GLUT_SCREEN_WIDTH_MM        202
00429 #define GLUT_SCREEN_HEIGHT_MM       203
00430 #define GLUT_MENU_NUM_ITEMS     300
00431 #define GLUT_DISPLAY_MODE_POSSIBLE  400
00432 #define GLUT_INIT_WINDOW_X      500
00433 #define GLUT_INIT_WINDOW_Y      501
00434 #define GLUT_INIT_WINDOW_WIDTH      502
00435 #define GLUT_INIT_WINDOW_HEIGHT     503
00436 #define GLUT_INIT_DISPLAY_MODE      504
00437 #if (GLUT_API_VERSION >= 2)
00438 #define GLUT_ELAPSED_TIME       700
00439 #endif
00440 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
00441 #define GLUT_WINDOW_FORMAT_ID       123
00442 #endif
00443 
00444 #if (GLUT_API_VERSION >= 2)
00445 /* glutDeviceGet parameters. */
00446 #define GLUT_HAS_KEYBOARD       600
00447 #define GLUT_HAS_MOUSE          601
00448 #define GLUT_HAS_SPACEBALL      602
00449 #define GLUT_HAS_DIAL_AND_BUTTON_BOX    603
00450 #define GLUT_HAS_TABLET         604
00451 #define GLUT_NUM_MOUSE_BUTTONS      605
00452 #define GLUT_NUM_SPACEBALL_BUTTONS  606
00453 #define GLUT_NUM_BUTTON_BOX_BUTTONS 607
00454 #define GLUT_NUM_DIALS          608
00455 #define GLUT_NUM_TABLET_BUTTONS     609
00456 #endif
00457 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
00458 #define GLUT_DEVICE_IGNORE_KEY_REPEAT   610
00459 #define GLUT_DEVICE_KEY_REPEAT          611
00460 #define GLUT_HAS_JOYSTICK       612
00461 #define GLUT_OWNS_JOYSTICK      613
00462 #define GLUT_JOYSTICK_BUTTONS       614
00463 #define GLUT_JOYSTICK_AXES      615
00464 #define GLUT_JOYSTICK_POLL_RATE     616
00465 #endif
00466 
00467 #if (GLUT_API_VERSION >= 3)
00468 /* glutLayerGet parameters. */
00469 #define GLUT_OVERLAY_POSSIBLE           800
00470 #define GLUT_LAYER_IN_USE       801
00471 #define GLUT_HAS_OVERLAY        802
00472 #define GLUT_TRANSPARENT_INDEX      803
00473 #define GLUT_NORMAL_DAMAGED     804
00474 #define GLUT_OVERLAY_DAMAGED        805
00475 
00476 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
00477 /* glutVideoResizeGet parameters. */
00478 #define GLUT_VIDEO_RESIZE_POSSIBLE  900
00479 #define GLUT_VIDEO_RESIZE_IN_USE    901
00480 #define GLUT_VIDEO_RESIZE_X_DELTA   902
00481 #define GLUT_VIDEO_RESIZE_Y_DELTA   903
00482 #define GLUT_VIDEO_RESIZE_WIDTH_DELTA   904
00483 #define GLUT_VIDEO_RESIZE_HEIGHT_DELTA  905
00484 #define GLUT_VIDEO_RESIZE_X     906
00485 #define GLUT_VIDEO_RESIZE_Y     907
00486 #define GLUT_VIDEO_RESIZE_WIDTH     908
00487 #define GLUT_VIDEO_RESIZE_HEIGHT    909
00488 #endif
00489 
00490 /* glutUseLayer parameters. */
00491 #define GLUT_NORMAL         0
00492 #define GLUT_OVERLAY            1
00493 
00494 /* glutGetModifiers return mask. */
00495 #define GLUT_ACTIVE_SHIFT               1
00496 #define GLUT_ACTIVE_CTRL                2
00497 #define GLUT_ACTIVE_ALT                 4
00498 
00499 /* glutSetCursor parameters. */
00500 /* Basic arrows. */
00501 #define GLUT_CURSOR_RIGHT_ARROW     0
00502 #define GLUT_CURSOR_LEFT_ARROW      1
00503 /* Symbolic cursor shapes. */
00504 #define GLUT_CURSOR_INFO        2
00505 #define GLUT_CURSOR_DESTROY     3
00506 #define GLUT_CURSOR_HELP        4
00507 #define GLUT_CURSOR_CYCLE       5
00508 #define GLUT_CURSOR_SPRAY       6
00509 #define GLUT_CURSOR_WAIT        7
00510 #define GLUT_CURSOR_TEXT        8
00511 #define GLUT_CURSOR_CROSSHAIR       9
00512 /* Directional cursors. */
00513 #define GLUT_CURSOR_UP_DOWN     10
00514 #define GLUT_CURSOR_LEFT_RIGHT      11
00515 /* Sizing cursors. */
00516 #define GLUT_CURSOR_TOP_SIDE        12
00517 #define GLUT_CURSOR_BOTTOM_SIDE     13
00518 #define GLUT_CURSOR_LEFT_SIDE       14
00519 #define GLUT_CURSOR_RIGHT_SIDE      15
00520 #define GLUT_CURSOR_TOP_LEFT_CORNER 16
00521 #define GLUT_CURSOR_TOP_RIGHT_CORNER    17
00522 #define GLUT_CURSOR_BOTTOM_RIGHT_CORNER 18
00523 #define GLUT_CURSOR_BOTTOM_LEFT_CORNER  19
00524 /* Inherit from parent window. */
00525 #define GLUT_CURSOR_INHERIT     100
00526 /* Blank cursor. */
00527 #define GLUT_CURSOR_NONE        101
00528 /* Fullscreen crosshair (if available). */
00529 #define GLUT_CURSOR_FULL_CROSSHAIR  102
00530 #endif
00531 
00532 /* GLUT initialization sub-API. */
00533 GLUTAPI void GLUTAPIENTRY glutInit(int *argcp, char **argv);
00534 #if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
00535 GLUTAPI void GLUTAPIENTRY __glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int));
00536 #ifndef GLUT_BUILDING_LIB
00537 static void GLUTAPIENTRY glutInit_ATEXIT_HACK(int *argcp, char **argv) { __glutInitWithExit(argcp, argv, exit); }
00538 #define glutInit glutInit_ATEXIT_HACK
00539 #endif
00540 #endif
00541 GLUTAPI void GLUTAPIENTRY glutInitDisplayMode(unsigned int mode);
00542 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
00543 GLUTAPI void GLUTAPIENTRY glutInitDisplayString(const char *string);
00544 #endif
00545 GLUTAPI void GLUTAPIENTRY glutInitWindowPosition(int x, int y);
00546 GLUTAPI void GLUTAPIENTRY glutInitWindowSize(int width, int height);
00547 GLUTAPI void GLUTAPIENTRY glutMainLoop(void);
00548 
00549 /* GLUT window sub-API. */
00550 GLUTAPI int GLUTAPIENTRY glutCreateWindow(const char *title);
00551 #if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
00552 GLUTAPI int GLUTAPIENTRY __glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int));
00553 #ifndef GLUT_BUILDING_LIB
00554 static int GLUTAPIENTRY glutCreateWindow_ATEXIT_HACK(const char *title) { return __glutCreateWindowWithExit(title, exit); }
00555 #define glutCreateWindow glutCreateWindow_ATEXIT_HACK
00556 #endif
00557 #endif
00558 GLUTAPI int GLUTAPIENTRY glutCreateSubWindow(int win, int x, int y, int width, int height);
00559 GLUTAPI void GLUTAPIENTRY glutDestroyWindow(int win);
00560 GLUTAPI void GLUTAPIENTRY glutPostRedisplay(void);
00561 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
00562 GLUTAPI void GLUTAPIENTRY glutPostWindowRedisplay(int win);
00563 #endif
00564 GLUTAPI void GLUTAPIENTRY glutSwapBuffers(void);
00565 GLUTAPI int GLUTAPIENTRY glutGetWindow(void);
00566 GLUTAPI void GLUTAPIENTRY glutSetWindow(int win);
00567 GLUTAPI void GLUTAPIENTRY glutSetWindowTitle(const char *title);
00568 GLUTAPI void GLUTAPIENTRY glutSetIconTitle(const char *title);
00569 GLUTAPI void GLUTAPIENTRY glutPositionWindow(int x, int y);
00570 GLUTAPI void GLUTAPIENTRY glutReshapeWindow(int width, int height);
00571 GLUTAPI void GLUTAPIENTRY glutPopWindow(void);
00572 GLUTAPI void GLUTAPIENTRY glutPushWindow(void);
00573 GLUTAPI void GLUTAPIENTRY glutIconifyWindow(void);
00574 GLUTAPI void GLUTAPIENTRY glutShowWindow(void);
00575 GLUTAPI void GLUTAPIENTRY glutHideWindow(void);
00576 #if (GLUT_API_VERSION >= 3)
00577 GLUTAPI void GLUTAPIENTRY glutFullScreen(void);
00578 GLUTAPI void GLUTAPIENTRY glutSetCursor(int cursor);
00579 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
00580 GLUTAPI void GLUTAPIENTRY glutWarpPointer(int x, int y);
00581 #endif
00582 
00583 /* GLUT overlay sub-API. */
00584 GLUTAPI void GLUTAPIENTRY glutEstablishOverlay(void);
00585 GLUTAPI void GLUTAPIENTRY glutRemoveOverlay(void);
00586 GLUTAPI void GLUTAPIENTRY glutUseLayer(GLenum layer);
00587 GLUTAPI void GLUTAPIENTRY glutPostOverlayRedisplay(void);
00588 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
00589 GLUTAPI void GLUTAPIENTRY glutPostWindowOverlayRedisplay(int win);
00590 #endif
00591 GLUTAPI void GLUTAPIENTRY glutShowOverlay(void);
00592 GLUTAPI void GLUTAPIENTRY glutHideOverlay(void);
00593 #endif
00594 
00595 /* GLUT menu sub-API. */
00596 GLUTAPI int GLUTAPIENTRY glutCreateMenu(void (GLUTCALLBACK *func)(int));
00597 #if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
00598 GLUTAPI int GLUTAPIENTRY __glutCreateMenuWithExit(void (GLUTCALLBACK *func)(int), void (__cdecl *exitfunc)(int));
00599 #ifndef GLUT_BUILDING_LIB
00600 static int GLUTAPIENTRY glutCreateMenu_ATEXIT_HACK(void (GLUTCALLBACK *func)(int)) { return __glutCreateMenuWithExit(func, exit); }
00601 #define glutCreateMenu glutCreateMenu_ATEXIT_HACK
00602 #endif
00603 #endif
00604 GLUTAPI void GLUTAPIENTRY glutDestroyMenu(int menu);
00605 GLUTAPI int GLUTAPIENTRY glutGetMenu(void);
00606 GLUTAPI void GLUTAPIENTRY glutSetMenu(int menu);
00607 GLUTAPI void GLUTAPIENTRY glutAddMenuEntry(const char *label, int value);
00608 GLUTAPI void GLUTAPIENTRY glutAddSubMenu(const char *label, int submenu);
00609 GLUTAPI void GLUTAPIENTRY glutChangeToMenuEntry(int item, const char *label, int value);
00610 GLUTAPI void GLUTAPIENTRY glutChangeToSubMenu(int item, const char *label, int submenu);
00611 GLUTAPI void GLUTAPIENTRY glutRemoveMenuItem(int item);
00612 GLUTAPI void GLUTAPIENTRY glutAttachMenu(int button);
00613 GLUTAPI void GLUTAPIENTRY glutDetachMenu(int button);
00614 
00615 /* GLUT window callback sub-API. */
00616 GLUTAPI void GLUTAPIENTRY glutDisplayFunc(void (GLUTCALLBACK *func)(void));
00617 GLUTAPI void GLUTAPIENTRY glutReshapeFunc(void (GLUTCALLBACK *func)(int width, int height));
00618 GLUTAPI void GLUTAPIENTRY glutKeyboardFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y));
00619 GLUTAPI void GLUTAPIENTRY glutMouseFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y));
00620 GLUTAPI void GLUTAPIENTRY glutMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
00621 GLUTAPI void GLUTAPIENTRY glutPassiveMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
00622 GLUTAPI void GLUTAPIENTRY glutEntryFunc(void (GLUTCALLBACK *func)(int state));
00623 GLUTAPI void GLUTAPIENTRY glutVisibilityFunc(void (GLUTCALLBACK *func)(int state));
00624 GLUTAPI void GLUTAPIENTRY glutIdleFunc(void (GLUTCALLBACK *func)(void));
00625 GLUTAPI void GLUTAPIENTRY glutTimerFunc(unsigned int millis, void (GLUTCALLBACK *func)(int value), int value);
00626 GLUTAPI void GLUTAPIENTRY glutMenuStateFunc(void (GLUTCALLBACK *func)(int state));
00627 #if (GLUT_API_VERSION >= 2)
00628 GLUTAPI void GLUTAPIENTRY glutSpecialFunc(void (GLUTCALLBACK *func)(int key, int x, int y));
00629 GLUTAPI void GLUTAPIENTRY glutSpaceballMotionFunc(void (GLUTCALLBACK *func)(int x, int y, int z));
00630 GLUTAPI void GLUTAPIENTRY glutSpaceballRotateFunc(void (GLUTCALLBACK *func)(int x, int y, int z));
00631 GLUTAPI void GLUTAPIENTRY glutSpaceballButtonFunc(void (GLUTCALLBACK *func)(int button, int state));
00632 GLUTAPI void GLUTAPIENTRY glutButtonBoxFunc(void (GLUTCALLBACK *func)(int button, int state));
00633 GLUTAPI void GLUTAPIENTRY glutDialsFunc(void (GLUTCALLBACK *func)(int dial, int value));
00634 GLUTAPI void GLUTAPIENTRY glutTabletMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
00635 GLUTAPI void GLUTAPIENTRY glutTabletButtonFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y));
00636 #if (GLUT_API_VERSION >= 3)
00637 GLUTAPI void GLUTAPIENTRY glutMenuStatusFunc(void (GLUTCALLBACK *func)(int status, int x, int y));
00638 GLUTAPI void GLUTAPIENTRY glutOverlayDisplayFunc(void (GLUTCALLBACK *func)(void));
00639 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
00640 GLUTAPI void GLUTAPIENTRY glutWindowStatusFunc(void (GLUTCALLBACK *func)(int state));
00641 #endif
00642 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
00643 GLUTAPI void GLUTAPIENTRY glutKeyboardUpFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y));
00644 GLUTAPI void GLUTAPIENTRY glutSpecialUpFunc(void (GLUTCALLBACK *func)(int key, int x, int y));
00645 GLUTAPI void GLUTAPIENTRY glutJoystickFunc(void (GLUTCALLBACK *func)(unsigned int buttonMask, int x, int y, int z), int pollInterval);
00646 #endif
00647 #endif
00648 #endif
00649 
00650 /* GLUT color index sub-API. */
00651 GLUTAPI void GLUTAPIENTRY glutSetColor(int, GLfloat red, GLfloat green, GLfloat blue);
00652 GLUTAPI GLfloat GLUTAPIENTRY glutGetColor(int ndx, int component);
00653 GLUTAPI void GLUTAPIENTRY glutCopyColormap(int win);
00654 
00655 /* GLUT state retrieval sub-API. */
00656 GLUTAPI int GLUTAPIENTRY glutGet(GLenum type);
00657 GLUTAPI int GLUTAPIENTRY glutDeviceGet(GLenum type);
00658 #if (GLUT_API_VERSION >= 2)
00659 /* GLUT extension support sub-API */
00660 GLUTAPI int GLUTAPIENTRY glutExtensionSupported(const char *name);
00661 #endif
00662 #if (GLUT_API_VERSION >= 3)
00663 GLUTAPI int GLUTAPIENTRY glutGetModifiers(void);
00664 GLUTAPI int GLUTAPIENTRY glutLayerGet(GLenum type);
00665 #endif
00666 #if (GLUT_API_VERSION >= 5)
00667 GLUTAPI void * GLUTAPIENTRY glutGetProcAddress(const char *procName);
00668 #endif
00669 
00670 /* GLUT font sub-API */
00671 GLUTAPI void GLUTAPIENTRY glutBitmapCharacter(void *font, int character);
00672 GLUTAPI int GLUTAPIENTRY glutBitmapWidth(void *font, int character);
00673 GLUTAPI void GLUTAPIENTRY glutStrokeCharacter(void *font, int character);
00674 GLUTAPI int GLUTAPIENTRY glutStrokeWidth(void *font, int character);
00675 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
00676 GLUTAPI int GLUTAPIENTRY glutBitmapLength(void *font, const unsigned char *string);
00677 GLUTAPI int GLUTAPIENTRY glutStrokeLength(void *font, const unsigned char *string);
00678 #endif
00679 
00680 /* GLUT pre-built models sub-API */
00681 GLUTAPI void GLUTAPIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks);
00682 GLUTAPI void GLUTAPIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks);
00683 GLUTAPI void GLUTAPIENTRY glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
00684 GLUTAPI void GLUTAPIENTRY glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
00685 GLUTAPI void GLUTAPIENTRY glutWireCube(GLdouble size);
00686 GLUTAPI void GLUTAPIENTRY glutSolidCube(GLdouble size);
00687 GLUTAPI void GLUTAPIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
00688 GLUTAPI void GLUTAPIENTRY glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
00689 GLUTAPI void GLUTAPIENTRY glutWireDodecahedron(void);
00690 GLUTAPI void GLUTAPIENTRY glutSolidDodecahedron(void);
00691 GLUTAPI void GLUTAPIENTRY glutWireTeapot(GLdouble size);
00692 GLUTAPI void GLUTAPIENTRY glutSolidTeapot(GLdouble size);
00693 GLUTAPI void GLUTAPIENTRY glutWireOctahedron(void);
00694 GLUTAPI void GLUTAPIENTRY glutSolidOctahedron(void);
00695 GLUTAPI void GLUTAPIENTRY glutWireTetrahedron(void);
00696 GLUTAPI void GLUTAPIENTRY glutSolidTetrahedron(void);
00697 GLUTAPI void GLUTAPIENTRY glutWireIcosahedron(void);
00698 GLUTAPI void GLUTAPIENTRY glutSolidIcosahedron(void);
00699 
00700 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
00701 /* GLUT video resize sub-API. */
00702 GLUTAPI int GLUTAPIENTRY glutVideoResizeGet(GLenum param);
00703 GLUTAPI void GLUTAPIENTRY glutSetupVideoResizing(void);
00704 GLUTAPI void GLUTAPIENTRY glutStopVideoResizing(void);
00705 GLUTAPI void GLUTAPIENTRY glutVideoResize(int x, int y, int width, int height);
00706 GLUTAPI void GLUTAPIENTRY glutVideoPan(int x, int y, int width, int height);
00707 
00708 /* GLUT debugging sub-API. */
00709 GLUTAPI void GLUTAPIENTRY glutReportErrors(void);
00710 #endif
00711 
00712 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
00713 /* GLUT device control sub-API. */
00714 /* glutSetKeyRepeat modes. */
00715 #define GLUT_KEY_REPEAT_OFF     0
00716 #define GLUT_KEY_REPEAT_ON      1
00717 #define GLUT_KEY_REPEAT_DEFAULT     2
00718 
00719 /* Joystick button masks. */
00720 #define GLUT_JOYSTICK_BUTTON_A      1
00721 #define GLUT_JOYSTICK_BUTTON_B      2
00722 #define GLUT_JOYSTICK_BUTTON_C      4
00723 #define GLUT_JOYSTICK_BUTTON_D      8
00724 
00725 GLUTAPI void GLUTAPIENTRY glutIgnoreKeyRepeat(int ignore);
00726 GLUTAPI void GLUTAPIENTRY glutSetKeyRepeat(int repeatMode);
00727 GLUTAPI void GLUTAPIENTRY glutForceJoystickFunc(void);
00728 
00729 /* GLUT game mode sub-API. */
00730 /* glutGameModeGet. */
00731 #define GLUT_GAME_MODE_ACTIVE           0
00732 #define GLUT_GAME_MODE_POSSIBLE         1
00733 #define GLUT_GAME_MODE_WIDTH            2
00734 #define GLUT_GAME_MODE_HEIGHT           3
00735 #define GLUT_GAME_MODE_PIXEL_DEPTH      4
00736 #define GLUT_GAME_MODE_REFRESH_RATE     5
00737 #define GLUT_GAME_MODE_DISPLAY_CHANGED  6
00738 
00739 GLUTAPI void GLUTAPIENTRY glutGameModeString(const char *string);
00740 GLUTAPI int GLUTAPIENTRY glutEnterGameMode(void);
00741 GLUTAPI void GLUTAPIENTRY glutLeaveGameMode(void);
00742 GLUTAPI int GLUTAPIENTRY glutGameModeGet(GLenum mode);
00743 #endif
00744 
00745 #ifdef __cplusplus
00746 }
00747 #endif
00748 
00749 #if 0
00750 #ifdef GLUT_APIENTRY_DEFINED
00751 # undef GLUT_APIENTRY_DEFINED
00752 # undef APIENTRY
00753 #endif
00754 
00755 #ifdef GLUT_WINGDIAPI_DEFINED
00756 # undef GLUT_WINGDIAPI_DEFINED
00757 # undef WINGDIAPI
00758 #endif
00759 
00760 #ifdef GLUT_DEFINED___CDECL
00761 # undef GLUT_DEFINED___CDECL
00762 # undef __cdecl
00763 #endif
00764 
00765 #ifdef GLUT_DEFINED__CRTIMP
00766 # undef GLUT_DEFINED__CRTIMP
00767 # undef _CRTIMP
00768 #endif
00769 #endif
00770 
00771 #endif                  /* __glut_h__ */

Generated on Fri Feb 27 12:01:39 2004 for Glitch by doxygen 1.3.2