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