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.

glut.h 29KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766
  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) || defined(__CYGWIN32__)
  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. # pragma warning( push )
  136. # pragma warning( disable : 4273 ) /* 'function' : inconsistent DLL linkage. dllexport assumed. */
  137. # define WGLAPI __declspec(dllimport)
  138. WGLAPI int GLAPIENTRY wglDeleteContext(HGLRC);
  139. WGLAPI int GLAPIENTRY wglMakeCurrent(HDC,HGLRC);
  140. WGLAPI int GLAPIENTRY wglSetPixelFormat(HDC, int, const PIXELFORMATDESCRIPTOR *);
  141. WGLAPI int GLAPIENTRY wglSwapBuffers(HDC hdc);
  142. WGLAPI HDC GLAPIENTRY wglGetCurrentDC(void);
  143. WGLAPI HGLRC GLAPIENTRY wglCreateContext(HDC);
  144. WGLAPI HGLRC GLAPIENTRY wglCreateLayerContext(HDC,int);
  145. WGLAPI HGLRC GLAPIENTRY wglGetCurrentContext(void);
  146. WGLAPI PROC GLAPIENTRY wglGetProcAddress(const char*);
  147. WGLAPI int GLAPIENTRY wglChoosePixelFormat(HDC, const PIXELFORMATDESCRIPTOR *);
  148. WGLAPI int GLAPIENTRY wglCopyContext(HGLRC, HGLRC, unsigned int);
  149. WGLAPI int GLAPIENTRY wglDeleteContext(HGLRC);
  150. WGLAPI int GLAPIENTRY wglDescribeLayerPlane(HDC, int, int, unsigned int,LPLAYERPLANEDESCRIPTOR);
  151. WGLAPI int GLAPIENTRY wglDescribePixelFormat(HDC,int, unsigned int, LPPIXELFORMATDESCRIPTOR);
  152. WGLAPI int GLAPIENTRY wglGetLayerPaletteEntries(HDC, int, int, int,COLORREF *);
  153. WGLAPI int GLAPIENTRY wglGetPixelFormat(HDC hdc);
  154. WGLAPI int GLAPIENTRY wglMakeCurrent(HDC, HGLRC);
  155. WGLAPI int GLAPIENTRY wglRealizeLayerPalette(HDC, int, int);
  156. WGLAPI int GLAPIENTRY wglSetLayerPaletteEntries(HDC, int, int, int,const COLORREF *);
  157. WGLAPI int GLAPIENTRY wglShareLists(HGLRC, HGLRC);
  158. WGLAPI int GLAPIENTRY wglSwapLayerBuffers(HDC, unsigned int);
  159. WGLAPI int GLAPIENTRY wglUseFontBitmapsA(HDC, unsigned long, unsigned long, unsigned long);
  160. WGLAPI int GLAPIENTRY wglUseFontBitmapsW(HDC, unsigned long, unsigned long, unsigned long);
  161. WGLAPI int GLAPIENTRY wglUseFontOutlinesA(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
  162. WGLAPI int GLAPIENTRY wglUseFontOutlinesW(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
  163. WGLAPI int GLAPIENTRY SwapBuffers(HDC);
  164. WGLAPI int GLAPIENTRY ChoosePixelFormat(HDC,const PIXELFORMATDESCRIPTOR *);
  165. WGLAPI int GLAPIENTRY DescribePixelFormat(HDC,int,unsigned int,LPPIXELFORMATDESCRIPTOR);
  166. WGLAPI int GLAPIENTRY GetPixelFormat(HDC);
  167. WGLAPI int GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *);
  168. # undef WGLAPI
  169. # pragma warning( pop )
  170. #endif
  171. #else /* _WIN32 not defined */
  172. /* Define GLUTAPIENTRY and GLUTCALLBACK to nothing if we aren't on Win32. */
  173. # define GLUTAPIENTRY
  174. # define GLUTAPIENTRYV
  175. # define GLUT_APIENTRY_DEFINED
  176. # define GLUTCALLBACK
  177. # define GLUTAPI extern
  178. /* Prototype exit for the non-Win32 case (see above). */
  179. /*extern void exit(int); this screws up gcc -ansi -pedantic! */
  180. #endif
  181. /**
  182. GLUT API revision history:
  183. GLUT_API_VERSION is updated to reflect incompatible GLUT
  184. API changes (interface changes, semantic changes, deletions,
  185. or additions).
  186. GLUT_API_VERSION=1 First public release of GLUT. 11/29/94
  187. GLUT_API_VERSION=2 Added support for OpenGL/GLX multisampling,
  188. extension. Supports new input devices like tablet, dial and button
  189. box, and Spaceball. Easy to query OpenGL extensions.
  190. GLUT_API_VERSION=3 glutMenuStatus added.
  191. GLUT_API_VERSION=4 glutInitDisplayString, glutWarpPointer,
  192. glutBitmapLength, glutStrokeLength, glutWindowStatusFunc, dynamic
  193. video resize subAPI, glutPostWindowRedisplay, glutKeyboardUpFunc,
  194. glutSpecialUpFunc, glutIgnoreKeyRepeat, glutSetKeyRepeat,
  195. glutJoystickFunc, glutForceJoystickFunc (NOT FINALIZED!).
  196. **/
  197. #ifndef GLUT_API_VERSION /* allow this to be overriden */
  198. #define GLUT_API_VERSION 3
  199. #endif
  200. /**
  201. GLUT implementation revision history:
  202. GLUT_XLIB_IMPLEMENTATION is updated to reflect both GLUT
  203. API revisions and implementation revisions (ie, bug fixes).
  204. GLUT_XLIB_IMPLEMENTATION=1 mjk's first public release of
  205. GLUT Xlib-based implementation. 11/29/94
  206. GLUT_XLIB_IMPLEMENTATION=2 mjk's second public release of
  207. GLUT Xlib-based implementation providing GLUT version 2
  208. interfaces.
  209. GLUT_XLIB_IMPLEMENTATION=3 mjk's GLUT 2.2 images. 4/17/95
  210. GLUT_XLIB_IMPLEMENTATION=4 mjk's GLUT 2.3 images. 6/?/95
  211. GLUT_XLIB_IMPLEMENTATION=5 mjk's GLUT 3.0 images. 10/?/95
  212. GLUT_XLIB_IMPLEMENTATION=7 mjk's GLUT 3.1+ with glutWarpPoitner. 7/24/96
  213. GLUT_XLIB_IMPLEMENTATION=8 mjk's GLUT 3.1+ with glutWarpPoitner
  214. and video resize. 1/3/97
  215. GLUT_XLIB_IMPLEMENTATION=9 mjk's GLUT 3.4 release with early GLUT 4 routines.
  216. GLUT_XLIB_IMPLEMENTATION=11 Mesa 2.5's GLUT 3.6 release.
  217. GLUT_XLIB_IMPLEMENTATION=12 mjk's GLUT 3.6 release with early GLUT 4 routines + signal handling.
  218. GLUT_XLIB_IMPLEMENTATION=13 mjk's GLUT 3.7 beta with GameGLUT support.
  219. GLUT_XLIB_IMPLEMENTATION=14 mjk's GLUT 3.7 beta with f90gl friend interface.
  220. GLUT_XLIB_IMPLEMENTATION=15 mjk's GLUT 3.7 beta sync'ed with Mesa <GL/glut.h>
  221. **/
  222. #ifndef GLUT_XLIB_IMPLEMENTATION /* Allow this to be overriden. */
  223. #define GLUT_XLIB_IMPLEMENTATION 15
  224. #endif
  225. /* Display mode bit masks. */
  226. #define GLUT_RGB 0
  227. #define GLUT_RGBA GLUT_RGB
  228. #define GLUT_INDEX 1
  229. #define GLUT_SINGLE 0
  230. #define GLUT_DOUBLE 2
  231. #define GLUT_ACCUM 4
  232. #define GLUT_ALPHA 8
  233. #define GLUT_DEPTH 16
  234. #define GLUT_STENCIL 32
  235. #if (GLUT_API_VERSION >= 2)
  236. #define GLUT_MULTISAMPLE 128
  237. #define GLUT_STEREO 256
  238. #endif
  239. #if (GLUT_API_VERSION >= 3)
  240. #define GLUT_LUMINANCE 512
  241. #endif
  242. /* Mouse buttons. */
  243. #define GLUT_LEFT_BUTTON 0
  244. #define GLUT_MIDDLE_BUTTON 1
  245. #define GLUT_RIGHT_BUTTON 2
  246. /* Mouse button state. */
  247. #define GLUT_DOWN 0
  248. #define GLUT_UP 1
  249. #if (GLUT_API_VERSION >= 2)
  250. /* function keys */
  251. #define GLUT_KEY_F1 1
  252. #define GLUT_KEY_F2 2
  253. #define GLUT_KEY_F3 3
  254. #define GLUT_KEY_F4 4
  255. #define GLUT_KEY_F5 5
  256. #define GLUT_KEY_F6 6
  257. #define GLUT_KEY_F7 7
  258. #define GLUT_KEY_F8 8
  259. #define GLUT_KEY_F9 9
  260. #define GLUT_KEY_F10 10
  261. #define GLUT_KEY_F11 11
  262. #define GLUT_KEY_F12 12
  263. /* directional keys */
  264. #define GLUT_KEY_LEFT 100
  265. #define GLUT_KEY_UP 101
  266. #define GLUT_KEY_RIGHT 102
  267. #define GLUT_KEY_DOWN 103
  268. #define GLUT_KEY_PAGE_UP 104
  269. #define GLUT_KEY_PAGE_DOWN 105
  270. #define GLUT_KEY_HOME 106
  271. #define GLUT_KEY_END 107
  272. #define GLUT_KEY_INSERT 108
  273. #endif
  274. /* Entry/exit state. */
  275. #define GLUT_LEFT 0
  276. #define GLUT_ENTERED 1
  277. /* Menu usage state. */
  278. #define GLUT_MENU_NOT_IN_USE 0
  279. #define GLUT_MENU_IN_USE 1
  280. /* Visibility state. */
  281. #define GLUT_NOT_VISIBLE 0
  282. #define GLUT_VISIBLE 1
  283. /* Window status state. */
  284. #define GLUT_HIDDEN 0
  285. #define GLUT_FULLY_RETAINED 1
  286. #define GLUT_PARTIALLY_RETAINED 2
  287. #define GLUT_FULLY_COVERED 3
  288. /* Color index component selection values. */
  289. #define GLUT_RED 0
  290. #define GLUT_GREEN 1
  291. #define GLUT_BLUE 2
  292. /* Layers for use. */
  293. #define GLUT_NORMAL 0
  294. #define GLUT_OVERLAY 1
  295. #if defined(_WIN32)
  296. /* Stroke font constants (use these in GLUT program). */
  297. #define GLUT_STROKE_ROMAN ((void*)0)
  298. #define GLUT_STROKE_MONO_ROMAN ((void*)1)
  299. /* Bitmap font constants (use these in GLUT program). */
  300. #define GLUT_BITMAP_9_BY_15 ((void*)2)
  301. #define GLUT_BITMAP_8_BY_13 ((void*)3)
  302. #define GLUT_BITMAP_TIMES_ROMAN_10 ((void*)4)
  303. #define GLUT_BITMAP_TIMES_ROMAN_24 ((void*)5)
  304. #if (GLUT_API_VERSION >= 3)
  305. #define GLUT_BITMAP_HELVETICA_10 ((void*)6)
  306. #define GLUT_BITMAP_HELVETICA_12 ((void*)7)
  307. #define GLUT_BITMAP_HELVETICA_18 ((void*)8)
  308. #endif
  309. #else
  310. /* Stroke font opaque addresses (use constants instead in source code). */
  311. GLUTAPI void *glutStrokeRoman;
  312. GLUTAPI void *glutStrokeMonoRoman;
  313. /* Stroke font constants (use these in GLUT program). */
  314. #define GLUT_STROKE_ROMAN (&glutStrokeRoman)
  315. #define GLUT_STROKE_MONO_ROMAN (&glutStrokeMonoRoman)
  316. /* Bitmap font opaque addresses (use constants instead in source code). */
  317. GLUTAPI void *glutBitmap9By15;
  318. GLUTAPI void *glutBitmap8By13;
  319. GLUTAPI void *glutBitmapTimesRoman10;
  320. GLUTAPI void *glutBitmapTimesRoman24;
  321. GLUTAPI void *glutBitmapHelvetica10;
  322. GLUTAPI void *glutBitmapHelvetica12;
  323. GLUTAPI void *glutBitmapHelvetica18;
  324. /* Bitmap font constants (use these in GLUT program). */
  325. #define GLUT_BITMAP_9_BY_15 (&glutBitmap9By15)
  326. #define GLUT_BITMAP_8_BY_13 (&glutBitmap8By13)
  327. #define GLUT_BITMAP_TIMES_ROMAN_10 (&glutBitmapTimesRoman10)
  328. #define GLUT_BITMAP_TIMES_ROMAN_24 (&glutBitmapTimesRoman24)
  329. #if (GLUT_API_VERSION >= 3)
  330. #define GLUT_BITMAP_HELVETICA_10 (&glutBitmapHelvetica10)
  331. #define GLUT_BITMAP_HELVETICA_12 (&glutBitmapHelvetica12)
  332. #define GLUT_BITMAP_HELVETICA_18 (&glutBitmapHelvetica18)
  333. #endif
  334. #endif
  335. /* glutGet parameters. */
  336. #define GLUT_WINDOW_X 100
  337. #define GLUT_WINDOW_Y 101
  338. #define GLUT_WINDOW_WIDTH 102
  339. #define GLUT_WINDOW_HEIGHT 103
  340. #define GLUT_WINDOW_BUFFER_SIZE 104
  341. #define GLUT_WINDOW_STENCIL_SIZE 105
  342. #define GLUT_WINDOW_DEPTH_SIZE 106
  343. #define GLUT_WINDOW_RED_SIZE 107
  344. #define GLUT_WINDOW_GREEN_SIZE 108
  345. #define GLUT_WINDOW_BLUE_SIZE 109
  346. #define GLUT_WINDOW_ALPHA_SIZE 110
  347. #define GLUT_WINDOW_ACCUM_RED_SIZE 111
  348. #define GLUT_WINDOW_ACCUM_GREEN_SIZE 112
  349. #define GLUT_WINDOW_ACCUM_BLUE_SIZE 113
  350. #define GLUT_WINDOW_ACCUM_ALPHA_SIZE 114
  351. #define GLUT_WINDOW_DOUBLEBUFFER 115
  352. #define GLUT_WINDOW_RGBA 116
  353. #define GLUT_WINDOW_PARENT 117
  354. #define GLUT_WINDOW_NUM_CHILDREN 118
  355. #define GLUT_WINDOW_COLORMAP_SIZE 119
  356. #if (GLUT_API_VERSION >= 2)
  357. #define GLUT_WINDOW_NUM_SAMPLES 120
  358. #define GLUT_WINDOW_STEREO 121
  359. #endif
  360. #if (GLUT_API_VERSION >= 3)
  361. #define GLUT_WINDOW_CURSOR 122
  362. #endif
  363. #define GLUT_SCREEN_WIDTH 200
  364. #define GLUT_SCREEN_HEIGHT 201
  365. #define GLUT_SCREEN_WIDTH_MM 202
  366. #define GLUT_SCREEN_HEIGHT_MM 203
  367. #define GLUT_MENU_NUM_ITEMS 300
  368. #define GLUT_DISPLAY_MODE_POSSIBLE 400
  369. #define GLUT_INIT_WINDOW_X 500
  370. #define GLUT_INIT_WINDOW_Y 501
  371. #define GLUT_INIT_WINDOW_WIDTH 502
  372. #define GLUT_INIT_WINDOW_HEIGHT 503
  373. #define GLUT_INIT_DISPLAY_MODE 504
  374. #if (GLUT_API_VERSION >= 2)
  375. #define GLUT_ELAPSED_TIME 700
  376. #endif
  377. #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
  378. #define GLUT_WINDOW_FORMAT_ID 123
  379. #endif
  380. #if (GLUT_API_VERSION >= 2)
  381. /* glutDeviceGet parameters. */
  382. #define GLUT_HAS_KEYBOARD 600
  383. #define GLUT_HAS_MOUSE 601
  384. #define GLUT_HAS_SPACEBALL 602
  385. #define GLUT_HAS_DIAL_AND_BUTTON_BOX 603
  386. #define GLUT_HAS_TABLET 604
  387. #define GLUT_NUM_MOUSE_BUTTONS 605
  388. #define GLUT_NUM_SPACEBALL_BUTTONS 606
  389. #define GLUT_NUM_BUTTON_BOX_BUTTONS 607
  390. #define GLUT_NUM_DIALS 608
  391. #define GLUT_NUM_TABLET_BUTTONS 609
  392. #endif
  393. #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
  394. #define GLUT_DEVICE_IGNORE_KEY_REPEAT 610
  395. #define GLUT_DEVICE_KEY_REPEAT 611
  396. #define GLUT_HAS_JOYSTICK 612
  397. #define GLUT_OWNS_JOYSTICK 613
  398. #define GLUT_JOYSTICK_BUTTONS 614
  399. #define GLUT_JOYSTICK_AXES 615
  400. #define GLUT_JOYSTICK_POLL_RATE 616
  401. #endif
  402. #if (GLUT_API_VERSION >= 3)
  403. /* glutLayerGet parameters. */
  404. #define GLUT_OVERLAY_POSSIBLE 800
  405. #define GLUT_LAYER_IN_USE 801
  406. #define GLUT_HAS_OVERLAY 802
  407. #define GLUT_TRANSPARENT_INDEX 803
  408. #define GLUT_NORMAL_DAMAGED 804
  409. #define GLUT_OVERLAY_DAMAGED 805
  410. #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
  411. /* glutVideoResizeGet parameters. */
  412. #define GLUT_VIDEO_RESIZE_POSSIBLE 900
  413. #define GLUT_VIDEO_RESIZE_IN_USE 901
  414. #define GLUT_VIDEO_RESIZE_X_DELTA 902
  415. #define GLUT_VIDEO_RESIZE_Y_DELTA 903
  416. #define GLUT_VIDEO_RESIZE_WIDTH_DELTA 904
  417. #define GLUT_VIDEO_RESIZE_HEIGHT_DELTA 905
  418. #define GLUT_VIDEO_RESIZE_X 906
  419. #define GLUT_VIDEO_RESIZE_Y 907
  420. #define GLUT_VIDEO_RESIZE_WIDTH 908
  421. #define GLUT_VIDEO_RESIZE_HEIGHT 909
  422. #endif
  423. /* glutUseLayer parameters. */
  424. #define GLUT_NORMAL 0
  425. #define GLUT_OVERLAY 1
  426. /* glutGetModifiers return mask. */
  427. #define GLUT_ACTIVE_SHIFT 1
  428. #define GLUT_ACTIVE_CTRL 2
  429. #define GLUT_ACTIVE_ALT 4
  430. /* glutSetCursor parameters. */
  431. /* Basic arrows. */
  432. #define GLUT_CURSOR_RIGHT_ARROW 0
  433. #define GLUT_CURSOR_LEFT_ARROW 1
  434. /* Symbolic cursor shapes. */
  435. #define GLUT_CURSOR_INFO 2
  436. #define GLUT_CURSOR_DESTROY 3
  437. #define GLUT_CURSOR_HELP 4
  438. #define GLUT_CURSOR_CYCLE 5
  439. #define GLUT_CURSOR_SPRAY 6
  440. #define GLUT_CURSOR_WAIT 7
  441. #define GLUT_CURSOR_TEXT 8
  442. #define GLUT_CURSOR_CROSSHAIR 9
  443. /* Directional cursors. */
  444. #define GLUT_CURSOR_UP_DOWN 10
  445. #define GLUT_CURSOR_LEFT_RIGHT 11
  446. /* Sizing cursors. */
  447. #define GLUT_CURSOR_TOP_SIDE 12
  448. #define GLUT_CURSOR_BOTTOM_SIDE 13
  449. #define GLUT_CURSOR_LEFT_SIDE 14
  450. #define GLUT_CURSOR_RIGHT_SIDE 15
  451. #define GLUT_CURSOR_TOP_LEFT_CORNER 16
  452. #define GLUT_CURSOR_TOP_RIGHT_CORNER 17
  453. #define GLUT_CURSOR_BOTTOM_RIGHT_CORNER 18
  454. #define GLUT_CURSOR_BOTTOM_LEFT_CORNER 19
  455. /* Inherit from parent window. */
  456. #define GLUT_CURSOR_INHERIT 100
  457. /* Blank cursor. */
  458. #define GLUT_CURSOR_NONE 101
  459. /* Fullscreen crosshair (if available). */
  460. #define GLUT_CURSOR_FULL_CROSSHAIR 102
  461. #endif
  462. /* GLUT initialization sub-API. */
  463. GLUTAPI void GLUTAPIENTRY glutInit(int *argcp, char **argv);
  464. #if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
  465. GLUTAPI void GLUTAPIENTRY __glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int));
  466. #ifndef GLUT_BUILDING_LIB
  467. static void GLUTAPIENTRY glutInit_ATEXIT_HACK(int *argcp, char **argv) { __glutInitWithExit(argcp, argv, exit); }
  468. #define glutInit glutInit_ATEXIT_HACK
  469. #endif
  470. #endif
  471. GLUTAPI void GLUTAPIENTRY glutInitDisplayMode(unsigned int mode);
  472. #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
  473. GLUTAPI void GLUTAPIENTRY glutInitDisplayString(const char *string);
  474. #endif
  475. GLUTAPI void GLUTAPIENTRY glutInitWindowPosition(int x, int y);
  476. GLUTAPI void GLUTAPIENTRY glutInitWindowSize(int width, int height);
  477. GLUTAPI void GLUTAPIENTRY glutMainLoop(void);
  478. /* GLUT window sub-API. */
  479. GLUTAPI int GLUTAPIENTRY glutCreateWindow(const char *title);
  480. #if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
  481. GLUTAPI int GLUTAPIENTRY __glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int));
  482. #ifndef GLUT_BUILDING_LIB
  483. static int GLUTAPIENTRY glutCreateWindow_ATEXIT_HACK(const char *title) { return __glutCreateWindowWithExit(title, exit); }
  484. #define glutCreateWindow glutCreateWindow_ATEXIT_HACK
  485. #endif
  486. #endif
  487. GLUTAPI int GLUTAPIENTRY glutCreateSubWindow(int win, int x, int y, int width, int height);
  488. GLUTAPI void GLUTAPIENTRY glutDestroyWindow(int win);
  489. GLUTAPI void GLUTAPIENTRY glutPostRedisplay(void);
  490. #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
  491. GLUTAPI void GLUTAPIENTRY glutPostWindowRedisplay(int win);
  492. #endif
  493. GLUTAPI void GLUTAPIENTRY glutSwapBuffers(void);
  494. GLUTAPI int GLUTAPIENTRY glutGetWindow(void);
  495. GLUTAPI void GLUTAPIENTRY glutSetWindow(int win);
  496. GLUTAPI void GLUTAPIENTRY glutSetWindowTitle(const char *title);
  497. GLUTAPI void GLUTAPIENTRY glutSetIconTitle(const char *title);
  498. GLUTAPI void GLUTAPIENTRY glutPositionWindow(int x, int y);
  499. GLUTAPI void GLUTAPIENTRY glutReshapeWindow(int width, int height);
  500. GLUTAPI void GLUTAPIENTRY glutPopWindow(void);
  501. GLUTAPI void GLUTAPIENTRY glutPushWindow(void);
  502. GLUTAPI void GLUTAPIENTRY glutIconifyWindow(void);
  503. GLUTAPI void GLUTAPIENTRY glutShowWindow(void);
  504. GLUTAPI void GLUTAPIENTRY glutHideWindow(void);
  505. #if (GLUT_API_VERSION >= 3)
  506. GLUTAPI void GLUTAPIENTRY glutFullScreen(void);
  507. GLUTAPI void GLUTAPIENTRY glutSetCursor(int cursor);
  508. #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
  509. GLUTAPI void GLUTAPIENTRY glutWarpPointer(int x, int y);
  510. #endif
  511. /* GLUT overlay sub-API. */
  512. GLUTAPI void GLUTAPIENTRY glutEstablishOverlay(void);
  513. GLUTAPI void GLUTAPIENTRY glutRemoveOverlay(void);
  514. GLUTAPI void GLUTAPIENTRY glutUseLayer(GLenum layer);
  515. GLUTAPI void GLUTAPIENTRY glutPostOverlayRedisplay(void);
  516. #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
  517. GLUTAPI void GLUTAPIENTRY glutPostWindowOverlayRedisplay(int win);
  518. #endif
  519. GLUTAPI void GLUTAPIENTRY glutShowOverlay(void);
  520. GLUTAPI void GLUTAPIENTRY glutHideOverlay(void);
  521. #endif
  522. /* GLUT menu sub-API. */
  523. GLUTAPI int GLUTAPIENTRY glutCreateMenu(void (GLUTCALLBACK *func)(int));
  524. #if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
  525. GLUTAPI int GLUTAPIENTRY __glutCreateMenuWithExit(void (GLUTCALLBACK *func)(int), void (__cdecl *exitfunc)(int));
  526. #ifndef GLUT_BUILDING_LIB
  527. static int GLUTAPIENTRY glutCreateMenu_ATEXIT_HACK(void (GLUTCALLBACK *func)(int)) { return __glutCreateMenuWithExit(func, exit); }
  528. #define glutCreateMenu glutCreateMenu_ATEXIT_HACK
  529. #endif
  530. #endif
  531. GLUTAPI void GLUTAPIENTRY glutDestroyMenu(int menu);
  532. GLUTAPI int GLUTAPIENTRY glutGetMenu(void);
  533. GLUTAPI void GLUTAPIENTRY glutSetMenu(int menu);
  534. GLUTAPI void GLUTAPIENTRY glutAddMenuEntry(const char *label, int value);
  535. GLUTAPI void GLUTAPIENTRY glutAddSubMenu(const char *label, int submenu);
  536. GLUTAPI void GLUTAPIENTRY glutChangeToMenuEntry(int item, const char *label, int value);
  537. GLUTAPI void GLUTAPIENTRY glutChangeToSubMenu(int item, const char *label, int submenu);
  538. GLUTAPI void GLUTAPIENTRY glutRemoveMenuItem(int item);
  539. GLUTAPI void GLUTAPIENTRY glutAttachMenu(int button);
  540. GLUTAPI void GLUTAPIENTRY glutDetachMenu(int button);
  541. /* GLUT window callback sub-API. */
  542. GLUTAPI void GLUTAPIENTRY glutDisplayFunc(void (GLUTCALLBACK *func)(void));
  543. GLUTAPI void GLUTAPIENTRY glutReshapeFunc(void (GLUTCALLBACK *func)(int width, int height));
  544. GLUTAPI void GLUTAPIENTRY glutKeyboardFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y));
  545. GLUTAPI void GLUTAPIENTRY glutMouseFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y));
  546. GLUTAPI void GLUTAPIENTRY glutMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
  547. GLUTAPI void GLUTAPIENTRY glutPassiveMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
  548. GLUTAPI void GLUTAPIENTRY glutEntryFunc(void (GLUTCALLBACK *func)(int state));
  549. GLUTAPI void GLUTAPIENTRY glutVisibilityFunc(void (GLUTCALLBACK *func)(int state));
  550. GLUTAPI void GLUTAPIENTRY glutIdleFunc(void (GLUTCALLBACK *func)(void));
  551. GLUTAPI void GLUTAPIENTRY glutTimerFunc(unsigned int millis, void (GLUTCALLBACK *func)(int value), int value);
  552. GLUTAPI void GLUTAPIENTRY glutMenuStateFunc(void (GLUTCALLBACK *func)(int state));
  553. #if (GLUT_API_VERSION >= 2)
  554. GLUTAPI void GLUTAPIENTRY glutSpecialFunc(void (GLUTCALLBACK *func)(int key, int x, int y));
  555. GLUTAPI void GLUTAPIENTRY glutSpaceballMotionFunc(void (GLUTCALLBACK *func)(int x, int y, int z));
  556. GLUTAPI void GLUTAPIENTRY glutSpaceballRotateFunc(void (GLUTCALLBACK *func)(int x, int y, int z));
  557. GLUTAPI void GLUTAPIENTRY glutSpaceballButtonFunc(void (GLUTCALLBACK *func)(int button, int state));
  558. GLUTAPI void GLUTAPIENTRY glutButtonBoxFunc(void (GLUTCALLBACK *func)(int button, int state));
  559. GLUTAPI void GLUTAPIENTRY glutDialsFunc(void (GLUTCALLBACK *func)(int dial, int value));
  560. GLUTAPI void GLUTAPIENTRY glutTabletMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
  561. GLUTAPI void GLUTAPIENTRY glutTabletButtonFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y));
  562. #if (GLUT_API_VERSION >= 3)
  563. GLUTAPI void GLUTAPIENTRY glutMenuStatusFunc(void (GLUTCALLBACK *func)(int status, int x, int y));
  564. GLUTAPI void GLUTAPIENTRY glutOverlayDisplayFunc(void (GLUTCALLBACK *func)(void));
  565. #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
  566. GLUTAPI void GLUTAPIENTRY glutWindowStatusFunc(void (GLUTCALLBACK *func)(int state));
  567. #endif
  568. #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
  569. GLUTAPI void GLUTAPIENTRY glutKeyboardUpFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y));
  570. GLUTAPI void GLUTAPIENTRY glutSpecialUpFunc(void (GLUTCALLBACK *func)(int key, int x, int y));
  571. GLUTAPI void GLUTAPIENTRY glutJoystickFunc(void (GLUTCALLBACK *func)(unsigned int buttonMask, int x, int y, int z), int pollInterval);
  572. #endif
  573. #endif
  574. #endif
  575. /* GLUT color index sub-API. */
  576. GLUTAPI void GLUTAPIENTRY glutSetColor(int, GLfloat red, GLfloat green, GLfloat blue);
  577. GLUTAPI GLfloat GLUTAPIENTRY glutGetColor(int ndx, int component);
  578. GLUTAPI void GLUTAPIENTRY glutCopyColormap(int win);
  579. /* GLUT state retrieval sub-API. */
  580. GLUTAPI int GLUTAPIENTRY glutGet(GLenum type);
  581. GLUTAPI int GLUTAPIENTRY glutDeviceGet(GLenum type);
  582. #if (GLUT_API_VERSION >= 2)
  583. /* GLUT extension support sub-API */
  584. GLUTAPI int GLUTAPIENTRY glutExtensionSupported(const char *name);
  585. #endif
  586. #if (GLUT_API_VERSION >= 3)
  587. GLUTAPI int GLUTAPIENTRY glutGetModifiers(void);
  588. GLUTAPI int GLUTAPIENTRY glutLayerGet(GLenum type);
  589. #endif
  590. /* GLUT font sub-API */
  591. GLUTAPI void GLUTAPIENTRY glutBitmapCharacter(void *font, int character);
  592. GLUTAPI int GLUTAPIENTRY glutBitmapWidth(void *font, int character);
  593. GLUTAPI void GLUTAPIENTRY glutStrokeCharacter(void *font, int character);
  594. GLUTAPI int GLUTAPIENTRY glutStrokeWidth(void *font, int character);
  595. #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
  596. GLUTAPI int GLUTAPIENTRY glutBitmapLength(void *font, const unsigned char *string);
  597. GLUTAPI int GLUTAPIENTRY glutStrokeLength(void *font, const unsigned char *string);
  598. #endif
  599. /* GLUT pre-built models sub-API */
  600. GLUTAPI void GLUTAPIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks);
  601. GLUTAPI void GLUTAPIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks);
  602. GLUTAPI void GLUTAPIENTRY glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
  603. GLUTAPI void GLUTAPIENTRY glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
  604. GLUTAPI void GLUTAPIENTRY glutWireCube(GLdouble size);
  605. GLUTAPI void GLUTAPIENTRY glutSolidCube(GLdouble size);
  606. GLUTAPI void GLUTAPIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
  607. GLUTAPI void GLUTAPIENTRY glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
  608. GLUTAPI void GLUTAPIENTRY glutWireDodecahedron(void);
  609. GLUTAPI void GLUTAPIENTRY glutSolidDodecahedron(void);
  610. GLUTAPI void GLUTAPIENTRY glutWireTeapot(GLdouble size);
  611. GLUTAPI void GLUTAPIENTRY glutSolidTeapot(GLdouble size);
  612. GLUTAPI void GLUTAPIENTRY glutWireOctahedron(void);
  613. GLUTAPI void GLUTAPIENTRY glutSolidOctahedron(void);
  614. GLUTAPI void GLUTAPIENTRY glutWireTetrahedron(void);
  615. GLUTAPI void GLUTAPIENTRY glutSolidTetrahedron(void);
  616. GLUTAPI void GLUTAPIENTRY glutWireIcosahedron(void);
  617. GLUTAPI void GLUTAPIENTRY glutSolidIcosahedron(void);
  618. #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
  619. /* GLUT video resize sub-API. */
  620. GLUTAPI int GLUTAPIENTRY glutVideoResizeGet(GLenum param);
  621. GLUTAPI void GLUTAPIENTRY glutSetupVideoResizing(void);
  622. GLUTAPI void GLUTAPIENTRY glutStopVideoResizing(void);
  623. GLUTAPI void GLUTAPIENTRY glutVideoResize(int x, int y, int width, int height);
  624. GLUTAPI void GLUTAPIENTRY glutVideoPan(int x, int y, int width, int height);
  625. /* GLUT debugging sub-API. */
  626. GLUTAPI void GLUTAPIENTRY glutReportErrors(void);
  627. #endif
  628. #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
  629. /* GLUT device control sub-API. */
  630. /* glutSetKeyRepeat modes. */
  631. #define GLUT_KEY_REPEAT_OFF 0
  632. #define GLUT_KEY_REPEAT_ON 1
  633. #define GLUT_KEY_REPEAT_DEFAULT 2
  634. /* Joystick button masks. */
  635. #define GLUT_JOYSTICK_BUTTON_A 1
  636. #define GLUT_JOYSTICK_BUTTON_B 2
  637. #define GLUT_JOYSTICK_BUTTON_C 4
  638. #define GLUT_JOYSTICK_BUTTON_D 8
  639. GLUTAPI void GLUTAPIENTRY glutIgnoreKeyRepeat(int ignore);
  640. GLUTAPI void GLUTAPIENTRY glutSetKeyRepeat(int repeatMode);
  641. GLUTAPI void GLUTAPIENTRY glutForceJoystickFunc(void);
  642. /* GLUT game mode sub-API. */
  643. /* glutGameModeGet. */
  644. #define GLUT_GAME_MODE_ACTIVE 0
  645. #define GLUT_GAME_MODE_POSSIBLE 1
  646. #define GLUT_GAME_MODE_WIDTH 2
  647. #define GLUT_GAME_MODE_HEIGHT 3
  648. #define GLUT_GAME_MODE_PIXEL_DEPTH 4
  649. #define GLUT_GAME_MODE_REFRESH_RATE 5
  650. #define GLUT_GAME_MODE_DISPLAY_CHANGED 6
  651. GLUTAPI void GLUTAPIENTRY glutGameModeString(const char *string);
  652. GLUTAPI int GLUTAPIENTRY glutEnterGameMode(void);
  653. GLUTAPI void GLUTAPIENTRY glutLeaveGameMode(void);
  654. GLUTAPI int GLUTAPIENTRY glutGameModeGet(GLenum mode);
  655. #endif
  656. #ifdef __cplusplus
  657. }
  658. #endif
  659. #if 0
  660. #ifdef GLUT_APIENTRY_DEFINED
  661. # undef GLUT_APIENTRY_DEFINED
  662. # undef APIENTRY
  663. #endif
  664. #ifdef GLUT_WINGDIAPI_DEFINED
  665. # undef GLUT_WINGDIAPI_DEFINED
  666. # undef WINGDIAPI
  667. #endif
  668. #ifdef GLUT_DEFINED___CDECL
  669. # undef GLUT_DEFINED___CDECL
  670. # undef __cdecl
  671. #endif
  672. #ifdef GLUT_DEFINED__CRTIMP
  673. # undef GLUT_DEFINED__CRTIMP
  674. # undef _CRTIMP
  675. #endif
  676. #endif
  677. #endif /* __glut_h__ */