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