glut.def 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  1. # This is the definition file for all GLUT stuff
  2. %COPY_INTERFACE
  3. { GLUT API revision history:
  4. GLUT_API_VERSION is updated to reflect incompatible GLUT
  5. API changes (interface changes, semantic changes, deletions,
  6. or additions).
  7. GLUT_API_VERSION=1 First public release of GLUT. 11/29/94
  8. GLUT_API_VERSION=2 Added support for OpenGL/GLX multisampling,
  9. extension. Supports new input devices like tablet, dial and button
  10. box, and Spaceball. Easy to query OpenGL extensions.
  11. GLUT_API_VERSION=3 glutMenuStatus added.
  12. GLUT_API_VERSION=4 glutInitDisplayString, glutWarpPointer,
  13. glutBitmapLength, glutStrokeLength, glutWindowStatusFunc, dynamic
  14. video resize subAPI, glutPostWindowRedisplay, glutKeyboardUpFunc,
  15. glutSpecialUpFunc, glutIgnoreKeyRepeat, glutSetKeyRepeat,
  16. glutJoystickFunc, glutForceJoystickFunc (NOT FINALIZED!). }
  17. const
  18. GLUT_API_VERSION = 4;
  19. // Display mode bit masks
  20. GLUT_RGB = 0;
  21. GLUT_RGBA = GLUT_RGB;
  22. GLUT_INDEX = 1;
  23. GLUT_SINGLE = 0;
  24. GLUT_DOUBLE = 2;
  25. GLUT_ACCUM = 4;
  26. GLUT_ALPHA = 8;
  27. GLUT_DEPTH = 16;
  28. GLUT_STENCIL = 32;
  29. GLUT_MULTISAMPLE = 128;
  30. GLUT_STEREO = 256;
  31. GLUT_LUMINANCE = 512;
  32. // Mouse buttons
  33. GLUT_LEFT_BUTTON = 0;
  34. GLUT_MIDDLE_BUTTON = 1;
  35. GLUT_RIGHT_BUTTON = 2;
  36. // Mouse button state
  37. GLUT_DOWN = 0;
  38. GLUT_UP = 1;
  39. // function keys
  40. GLUT_KEY_F1 = 1;
  41. GLUT_KEY_F2 = 2;
  42. GLUT_KEY_F3 = 3;
  43. GLUT_KEY_F4 = 4;
  44. GLUT_KEY_F5 = 5;
  45. GLUT_KEY_F6 = 6;
  46. GLUT_KEY_F7 = 7;
  47. GLUT_KEY_F8 = 8;
  48. GLUT_KEY_F9 = 9;
  49. GLUT_KEY_F10 = 10;
  50. GLUT_KEY_F11 = 11;
  51. GLUT_KEY_F12 = 12;
  52. // directional keys
  53. GLUT_KEY_LEFT = 100;
  54. GLUT_KEY_UP = 101;
  55. GLUT_KEY_RIGHT = 102;
  56. GLUT_KEY_DOWN = 103;
  57. GLUT_KEY_PAGE_UP = 104;
  58. GLUT_KEY_PAGE_DOWN = 105;
  59. GLUT_KEY_HOME = 106;
  60. GLUT_KEY_END = 107;
  61. GLUT_KEY_INSERT = 108;
  62. // Enter / exit state
  63. GLUT_LEFT = 0;
  64. GLUT_ENTERED = 1;
  65. // Menu usage state
  66. GLUT_MENU_NOT_IN_USE = 0;
  67. GLUT_MENU_IN_USE = 1;
  68. // Visibility state
  69. GLUT_NOT_VISIBLE = 0;
  70. GLUT_VISIBLE = 1;
  71. // Window status state
  72. GLUT_HIDDEN = 0;
  73. GLUT_FULLY_RETAINED = 1;
  74. GLUT_PARTIALLY_RETAINED = 2;
  75. GLUT_FULLY_COVERED = 3;
  76. // Color index component selection values
  77. GLUT_RED = 0;
  78. GLUT_GREEN = 1;
  79. GLUT_BLUE = 2;
  80. // Layers for use
  81. GLUT_NORMAL = 0;
  82. GLUT_OVERLAY = 1;
  83. // glutGet parameters
  84. GLUT_WINDOW_X = 100;
  85. GLUT_WINDOW_Y = 101;
  86. GLUT_WINDOW_WIDTH = 102;
  87. GLUT_WINDOW_HEIGHT = 103;
  88. GLUT_WINDOW_BUFFER_SIZE = 104;
  89. GLUT_WINDOW_STENCIL_SIZE = 105;
  90. GLUT_WINDOW_DEPTH_SIZE = 106;
  91. GLUT_WINDOW_RED_SIZE = 107;
  92. GLUT_WINDOW_GREEN_SIZE = 108;
  93. GLUT_WINDOW_BLUE_SIZE = 109;
  94. GLUT_WINDOW_ALPHA_SIZE = 110;
  95. GLUT_WINDOW_ACCUM_RED_SIZE = 111;
  96. GLUT_WINDOW_ACCUM_GREEN_SIZE = 112;
  97. GLUT_WINDOW_ACCUM_BLUE_SIZE = 113;
  98. GLUT_WINDOW_ACCUM_ALPHA_SIZE = 114;
  99. GLUT_WINDOW_DOUBLEBUFFER = 115;
  100. GLUT_WINDOW_RGBA = 116;
  101. GLUT_WINDOW_PARENT = 117;
  102. GLUT_WINDOW_NUM_CHILDREN = 118;
  103. GLUT_WINDOW_COLORMAP_SIZE = 119;
  104. GLUT_WINDOW_NUM_SAMPLES = 120;
  105. GLUT_WINDOW_STEREO = 121;
  106. GLUT_WINDOW_CURSOR = 122;
  107. GLUT_SCREEN_WIDTH = 200;
  108. GLUT_SCREEN_HEIGHT = 201;
  109. GLUT_SCREEN_WIDTH_MM = 202;
  110. GLUT_SCREEN_HEIGHT_MM = 203;
  111. GLUT_MENU_NUM_ITEMS = 300;
  112. GLUT_DISPLAY_MODE_POSSIBLE = 400;
  113. GLUT_INIT_WINDOW_X = 500;
  114. GLUT_INIT_WINDOW_Y = 501;
  115. GLUT_INIT_WINDOW_WIDTH = 502;
  116. GLUT_INIT_WINDOW_HEIGHT = 503;
  117. GLUT_INIT_DISPLAY_MODE = 504;
  118. GLUT_ELAPSED_TIME = 700;
  119. GLUT_WINDOW_FORMAT_ID = 123;
  120. // glutDeviceGet parameters
  121. GLUT_HAS_KEYBOARD = 600;
  122. GLUT_HAS_MOUSE = 601;
  123. GLUT_HAS_SPACEBALL = 602;
  124. GLUT_HAS_DIAL_AND_BUTTON_BOX = 603;
  125. GLUT_HAS_TABLET = 604;
  126. GLUT_NUM_MOUSE_BUTTONS = 605;
  127. GLUT_NUM_SPACEBALL_BUTTONS = 606;
  128. GLUT_NUM_BUTTON_BOX_BUTTONS = 607;
  129. GLUT_NUM_DIALS = 608;
  130. GLUT_NUM_TABLET_BUTTONS = 609;
  131. GLUT_DEVICE_IGNORE_KEY_REPEAT = 610;
  132. GLUT_DEVICE_KEY_REPEAT = 611;
  133. GLUT_HAS_JOYSTICK = 612;
  134. GLUT_OWNS_JOYSTICK = 613;
  135. GLUT_JOYSTICK_BUTTONS = 614;
  136. GLUT_JOYSTICK_AXES = 615;
  137. GLUT_JOYSTICK_POLL_RATE = 616;
  138. // glutLayerGet parameters
  139. GLUT_OVERLAY_POSSIBLE = 800;
  140. GLUT_LAYER_IN_USE = 801;
  141. GLUT_HAS_OVERLAY = 802;
  142. GLUT_TRANSPARENT_INDEX = 803;
  143. GLUT_NORMAL_DAMAGED = 804;
  144. GLUT_OVERLAY_DAMAGED = 805;
  145. // glutVideoResizeGet parameters
  146. GLUT_VIDEO_RESIZE_POSSIBLE = 900;
  147. GLUT_VIDEO_RESIZE_IN_USE = 901;
  148. GLUT_VIDEO_RESIZE_X_DELTA = 902;
  149. GLUT_VIDEO_RESIZE_Y_DELTA = 903;
  150. GLUT_VIDEO_RESIZE_WIDTH_DELTA = 904;
  151. GLUT_VIDEO_RESIZE_HEIGHT_DELTA= 905;
  152. GLUT_VIDEO_RESIZE_X = 906;
  153. GLUT_VIDEO_RESIZE_Y = 907;
  154. GLUT_VIDEO_RESIZE_WIDTH = 908;
  155. GLUT_VIDEO_RESIZE_HEIGHT = 909;
  156. // glutGetModifiers return mask
  157. GLUT_ACTIVE_SHIFT = 1;
  158. GLUT_ACTIVE_CTRL = 2;
  159. GLUT_ACTIVE_ALT = 4;
  160. // glutSetCursor parameters
  161. // Basic arrows
  162. GLUT_CURSOR_RIGHT_ARROW = 0;
  163. GLUT_CURSOR_LEFT_ARROW = 1;
  164. // Symbolic cursor shapes
  165. GLUT_CURSOR_INFO = 2;
  166. GLUT_CURSOR_DESTROY = 3;
  167. GLUT_CURSOR_HELP = 4;
  168. GLUT_CURSOR_CYCLE = 5;
  169. GLUT_CURSOR_SPRAY = 6;
  170. GLUT_CURSOR_WAIT = 7;
  171. GLUT_CURSOR_TEXT = 8;
  172. GLUT_CURSOR_CROSSHAIR = 9;
  173. // Directional cursors
  174. GLUT_CURSOR_UP_DOWN = 10;
  175. GLUT_CURSOR_LEFT_RIGHT = 11;
  176. // Sizing cursors
  177. GLUT_CURSOR_TOP_SIDE = 12;
  178. GLUT_CURSOR_BOTTOM_SIDE = 13;
  179. GLUT_CURSOR_LEFT_SIDE = 14;
  180. GLUT_CURSOR_RIGHT_SIDE = 15;
  181. GLUT_CURSOR_TOP_LEFT_CORNER = 16;
  182. GLUT_CURSOR_TOP_RIGHT_CORNER = 17;
  183. GLUT_CURSOR_BOTTOM_RIGHT_CORNER = 18;
  184. GLUT_CURSOR_BOTTOM_LEFT_CORNER = 19;
  185. // Inherit from parent window
  186. GLUT_CURSOR_INHERIT = 100;
  187. // Blank cursor
  188. GLUT_CURSOR_NONE = 101;
  189. // Fullscreen crosshair (if available)
  190. GLUT_CURSOR_FULL_CROSSHAIR = 102;
  191. type
  192. // GLUT menu sub-API
  193. TGlutCreateMenuFunc = procedure(arg: Int); cdecl;
  194. // GLUT window callback sub-API
  195. TGlutDisplayFunc = procedure; cdecl;
  196. TGlutReshapeFunc = procedure(width, height: Int); cdecl;
  197. TGlutKeyboardFunc = procedure(key: Char; x, y: Int); cdecl;
  198. TGlutMouseFunc = procedure(button, state, x, y: Int); cdecl;
  199. TGlutMotionFunc = procedure(x, y: Int); cdecl;
  200. TGlutPassiveMotionFunc = procedure(x, y: Int); cdecl;
  201. TGlutEntryFunc = procedure(x, y: Int); cdecl;
  202. TGlutVisibilityFunc = procedure(state: Int); cdecl;
  203. TGlutIdleFunc = procedure; cdecl;
  204. TGlutTimerFunc = procedure(value: Int); cdecl;
  205. TGlutMenuStateFunc = procedure(state: Int); cdecl;
  206. TGlutSpecialFunc = procedure(key, x, y: Int); cdecl;
  207. TGlutSpaceballMotionFunc = procedure(x, y, z: Int); cdecl;
  208. TGlutSpaceballRotateFunc = procedure(x, y, z: Int); cdecl;
  209. TGlutSpaceballButtonFunc = procedure(button, state: Int); cdecl;
  210. TGlutButtonBoxFunc = procedure(button, state: Int); cdecl;
  211. TGlutDialsFunc = procedure(dial, value: Int); cdecl;
  212. TGlutTabletMotionFunc = procedure(x, y: Int); cdecl;
  213. TGlutTabletButtonFunc = procedure(button, state, x, y: Int); cdecl;
  214. TGlutMenuStatusFunc = procedure(status, x, y: Int); cdecl;
  215. TGlutOverlayDisplayFunc = procedure; cdecl;
  216. TGlutWindowStatusFunc = procedure(state: Int); cdecl;
  217. TGlutKeyboardUpFunc = procedure(key: Char; x, y: Int); cdecl;
  218. TGlutSpecialUpFunc = procedure(key, x, y: Int); cdecl;
  219. TGlutJoystickFunc = procedure(buttonMask: UnsignedInt; x, y, z: Int); cdecl;
  220. const
  221. // GLUT device control sub-API
  222. // glutSetKeyRepeat modes.
  223. GLUT_KEY_REPEAT_OFF = 0;
  224. GLUT_KEY_REPEAT_ON = 1;
  225. GLUT_KEY_REPEAT_DEFAULT = 2;
  226. // Joystick button masks
  227. GLUT_JOYSTICK_BUTTON_A = 1;
  228. GLUT_JOYSTICK_BUTTON_B = 2;
  229. GLUT_JOYSTICK_BUTTON_C = 4;
  230. GLUT_JOYSTICK_BUTTON_D = 8;
  231. // GLUT game mode sub-API
  232. // glutGameModeGet
  233. GLUT_GAME_MODE_ACTIVE = 0;
  234. GLUT_GAME_MODE_POSSIBLE = 1;
  235. GLUT_GAME_MODE_WIDTH = 2;
  236. GLUT_GAME_MODE_HEIGHT = 3;
  237. GLUT_GAME_MODE_PIXEL_DEPTH = 4;
  238. GLUT_GAME_MODE_REFRESH_RATE = 5;
  239. GLUT_GAME_MODE_DISPLAY_CHANGED= 6;
  240. var
  241. %END
  242. #=====================================================================
  243. # Procedures and functions
  244. #=====================================================================
  245. %PROCS
  246. // GLUT initialization sub-API
  247. glutInit: procedure(argcp: PInt; argv: PPChar);
  248. glutInitDisplayMode: procedure(mode: UnsignedInt);
  249. glutInitDisplayString: procedure(const AString: PChar);
  250. glutInitWindowPosition: procedure(x, y: Int);
  251. glutInitWindowSize: procedure(width, height: Int);
  252. glutMainLoop: procedure;
  253. // GLUT window sub-API
  254. glutCreateWindow: function(const title: PChar): Int;
  255. glutCreateSubWindow: function(win, x, y, width, height: Int): Int;
  256. glutDestroyWindow: procedure(win: Int);
  257. glutPostRedisplay: procedure;
  258. glutPostWindowRedisplay: procedure(win: Int);
  259. glutSwapBuffers: procedure;
  260. glutGetWindow: function: Int;
  261. glutSetWindow: procedure(win: Int);
  262. glutSetWindowTitle: procedure(const title: PChar);
  263. glutSetIconTitle: procedure(title: PChar);
  264. glutPositionWindow: procedure(x, y: Int);
  265. glutReshapeWindow: procedure(width, height: Int);
  266. glutPopWindow: procedure;
  267. glutPushWindow: procedure;
  268. glutIconifyWindow: procedure;
  269. glutShowWindow: procedure;
  270. glutHideWindow: procedure;
  271. glutFullScreen: procedure;
  272. glutSetCursor: procedure(cursor: Int);
  273. glutWarpPointer: procedure(x, y: Int);
  274. // GLUT overlay sub-API
  275. glutEstablishOverlay: procedure;
  276. glutRemoveOverlay: procedure;
  277. glutUseLayer: procedure(layer: GLenum);
  278. glutPostOverlayRedisplay: procedure;
  279. glutPostWindowOverlayRedisplay: procedure(win: Int);
  280. glutShowOverlay: procedure;
  281. glutHideOverlay: procedure;
  282. // GLUT menu sub-API
  283. glutCreateMenu: function(func: TGlutCreateMenuFunc): Int;
  284. glutDestroyMenu: procedure(menu: Int);
  285. glutGetMenu: function: Int;
  286. glutSetMenu: procedure(menu: Int);
  287. glutAddMenuEntry: procedure(const ALabel: PChar; value: Int);
  288. glutAddSubMenu: procedure(const ALabel: PChar; submenu: Int);
  289. glutChangeToMenuEntry: procedure(item: Int; const ALabel: PChar; value: Int);
  290. glutChangeToSubMenu: procedure(item: Int; const ALabel: PChar; submenu: Int);
  291. glutRemoveMenuItem: procedure(item: Int);
  292. glutAttachMenu: procedure(button: Int);
  293. glutDetachMenu: procedure(button: Int);
  294. // GLUT window callback sub-API
  295. glutDisplayFunc: procedure(func: TGlutDisplayFunc);
  296. glutReshapeFunc: procedure(func: TGlutReshapeFunc);
  297. glutKeyboardFunc: procedure(func: TGlutKeyboardFunc);
  298. glutMouseFunc: procedure(func: TGlutMouseFunc);
  299. glutMotionFunc: procedure(func: TGlutMotionFunc);
  300. glutPassiveMotionFunc: procedure(func: TGlutPassiveMotionFunc);
  301. glutEntryFunc: procedure(func: TGlutEntryFunc);
  302. glutIdleFunc: procedure(func: TGlutIdleFunc);
  303. glutTimerFunc: procedure(millis: UnsignedInt; func: TGlutTimerFunc; value: Int);
  304. glutMenuStateFunc: procedure(func: TGlutMenuStateFunc);
  305. glutSpecialFunc: procedure(func: TGlutSpecialFunc);
  306. glutSpaceballMotionFunc: procedure(func: TGlutSpaceballMotionFunc);
  307. glutSpaceballRotateFunc: procedure(func: TGlutSpaceballRotateFunc);
  308. glutSpaceballButtonFunc: procedure(func: TGlutSpaceballButtonFunc);
  309. glutButtonBoxFunc: procedure(func: TGlutButtonBoxFunc);
  310. glutDialsFunc: procedure(func: TGlutDialsFunc);
  311. glutTabletMotionFunc: procedure(func: TGlutTabletMotionFunc);
  312. glutTabletButtonFunc: procedure(func: TGlutTabletButtonFunc);
  313. glutMenuStatusFunc: procedure(func: TGlutMenuStatusFunc);
  314. glutOverlayDisplayFunc: procedure(func: TGlutOverlayDisplayFunc);
  315. glutWindowStatusFunc: procedure(func: TGlutWindowStatusFunc);
  316. glutKeyboardUpFunc: procedure(func: TGlutKeyboardUpFunc);
  317. glutSpecialUpFunc: procedure(func: TGlutSpecialUpFunc);
  318. glutJoystickFunc: procedure(func: TGlutJoystickFunc; pollinterval: Int);
  319. // GLUT color index sub-API
  320. glutSetColor: procedure(index: Int; red, green, blue: GLfloat);
  321. glutGetColor: function(ndx, component: Int): GLfloat;
  322. glutCopyColormap: procedure(win: Int);
  323. // GLUT state retrieval sub-API
  324. glutGet: function(AType: GLEnum): Int;
  325. glutDeviceGet: function(AType: GLEnum): Int;
  326. glutExtensionSupported: function(const name: PChar): Int;
  327. glutGetModifiers: function: Int;
  328. glutLayerGet: function(AType: GLEnum): Int;
  329. // GLUT font sub-API
  330. glutBitmapCharacter: procedure(font: Pointer; character: Int);
  331. glutBitmapWidth: function(font: Pointer; character: Int): Int;
  332. glutStrokeCharacter: procedure(font: Pointer; character: Int);
  333. glutStrokeWidth: function(font: Pointer; character: Int): Int;
  334. glutBitmapLength: function(font: Pointer; const AString: PChar): Int;
  335. glutStrokeLength: function(font: Pointer; const AString: PChar): Int;
  336. // GLUT pre-built models sub-API
  337. glutWireSphere: procedure(radius: GLdouble; slices, stacks: GLint);
  338. glutSolidSphere: procedure(radius: GLdouble; slices, stacks: GLint);
  339. glutWireCone: procedure(base: GLdouble; height: GLdouble; slices, stacks: GLint);
  340. glutSolidCone: procedure(base: GLdouble; height: GLdouble; slices, stacks: GLint);
  341. glutWireCube: procedure(size: GLdouble);
  342. glutSolidCube: procedure(size: GLdouble);
  343. glutWireTorus: procedure(innerRadius, outerRadius: GLdouble; sides, rings: GLint);
  344. glutSolidTorus: procedure(innerRadius, outerRadius: GLdouble; sides, rings: GLint);
  345. glutWireDodecahedron: procedure;
  346. glutSolidDodecahedron: procedure;
  347. glutWireTeapot: procedure(size: GLdouble);
  348. glutSolidTeapot: procedure(size: GLdouble);
  349. glutWireOctahedron: procedure;
  350. glutSolidOctahedron: procedure;
  351. glutWireTetrahedron: procedure;
  352. glutSolidTetrahedron: procedure;
  353. glutWireIcosahedron: procedure;
  354. glutSolidIcosahedron: procedure;
  355. // GLUT video resize sub-API
  356. glutVideoResizeGet: function(param: GLenum): Int;
  357. glutSetupVideoResizing: procedure;
  358. glutStopVideoResizing: procedure;
  359. glutVideoResize: procedure(x, y, width, height: Int);
  360. glutVideoPan: procedure(x, y, width, height: Int);
  361. // GLUT debugging sub-API
  362. glutReportErrors: procedure;
  363. // GLUT device control sub-API
  364. glutIgnoreKeyRepeat: procedure(ignore: Int);
  365. glutSetKeyRepeat: procedure(repeatMode: Int);
  366. glutForceJoystickFunc: procedure;
  367. // GLUT game mode sub-API
  368. glutGameModeString: procedure(const AString: PChar);
  369. glutEnterGameMode: function: Integer;
  370. glutLeaveGameMode: procedure;
  371. glutGameModeGet: function(mode: GLEnum): Int;
  372. %END