Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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