Clone of mesa.
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

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