Advertisement
Guest User

glfw3.apc

a guest
Mar 12th, 2014
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 17.40 KB | None | 0 0
  1. /*************************************************************************
  2.  * GLFW - An OpenGL library
  3.  * API version: 3.0
  4.  * WWW:         http://www.glfw.org/
  5.  *------------------------------------------------------------------------
  6.  * Copyright (c) 2002-2006 Marcus Geelnard
  7.  * Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>
  8.  *
  9.  * This software is provided "as-is", without any express or implied
  10.  * warranty. In no event will the authors be held liable for any damages
  11.  * arising from the use of this software.
  12.  *
  13.  * Permission is granted to anyone to use this software for any purpose,
  14.  * including commercial applications, and to alter it and redistribute it
  15.  * freely, subject to the following restrictions:
  16.  *
  17.  * 1. The origin of this software must not be misrepresented; you must not
  18.  *    claim that you wrote the original software. If you use this software
  19.  *    in a product, an acknowledgment in the product documentation would
  20.  *    be appreciated but is not required.
  21.  *
  22.  * 2. Altered source versions must be plainly marked as such, and must not
  23.  *    be misrepresented as being the original software.
  24.  *
  25.  * 3. This notice may not be removed or altered from any source
  26.  *    distribution.
  27.  *
  28.  *************************************************************************/
  29.  
  30. const GLFW_VERSION_MAJOR           = 3;
  31. const GLFW_VERSION_MINOR           = 0;
  32. const GLFW_VERSION_REVISION        = 0;
  33.  
  34. const GLFW_KEY_SPACE               = 32;
  35. const GLFW_KEY_APOSTROPHE          = 39;  /*  */
  36. const GLFW_KEY_COMMA               = 44;  /* , */
  37. const GLFW_KEY_MINUS               = 45;  /* - */
  38. const GLFW_KEY_PERIOD              = 46;  /* . */
  39. const GLFW_KEY_SLASH               = 47;  /* / */
  40. const GLFW_KEY_0                   = 48;
  41. const GLFW_KEY_1                   = 49;
  42. const GLFW_KEY_2                   = 50;
  43. const GLFW_KEY_3                   = 51;
  44. const GLFW_KEY_4                   = 52;
  45. const GLFW_KEY_5                   = 53;
  46. const GLFW_KEY_6                   = 54;
  47. const GLFW_KEY_7                   = 55;
  48. const GLFW_KEY_8                   = 56;
  49. const GLFW_KEY_9                   = 57;
  50. const GLFW_KEY_SEMICOLON           = 59;  /* ; */
  51. const GLFW_KEY_EQUAL               = 61;  /* = */
  52. const GLFW_KEY_A                   = 65;
  53. const GLFW_KEY_B                   = 66;
  54. const GLFW_KEY_C                   = 67;
  55. const GLFW_KEY_D                   = 68;
  56. const GLFW_KEY_E                   = 69;
  57. const GLFW_KEY_F                   = 70;
  58. const GLFW_KEY_G                   = 71;
  59. const GLFW_KEY_H                   = 72;
  60. const GLFW_KEY_I                   = 73;
  61. const GLFW_KEY_J                   = 74;
  62. const GLFW_KEY_K                   = 75;
  63. const GLFW_KEY_L                   = 76;
  64. const GLFW_KEY_M                   = 77;
  65. const GLFW_KEY_N                   = 78;
  66. const GLFW_KEY_O                   = 79;
  67. const GLFW_KEY_P                   = 80;
  68. const GLFW_KEY_Q                   = 81;
  69. const GLFW_KEY_R                   = 82;
  70. const GLFW_KEY_S                   = 83;
  71. const GLFW_KEY_T                   = 84;
  72. const GLFW_KEY_U                   = 85;
  73. const GLFW_KEY_V                   = 86;
  74. const GLFW_KEY_W                   = 87;
  75. const GLFW_KEY_X                   = 88;
  76. const GLFW_KEY_Y                   = 89;
  77. const GLFW_KEY_Z                   = 90;
  78. const GLFW_KEY_LEFT_BRACKET        = 91;  /* [ */
  79. const GLFW_KEY_BACKSLASH           = 92;  /* \ */
  80. const GLFW_KEY_RIGHT_BRACKET       = 93;  /* ] */
  81. const GLFW_KEY_GRAVE_ACCENT        = 96;  /*  */
  82. const GLFW_KEY_WORLD_1             = 161; /* non-US #1 */
  83. const GLFW_KEY_WORLD_2             = 162; /* non-US #2 */
  84.  
  85. const GLFW_KEY_ESCAPE              = 256;
  86. const GLFW_KEY_ENTER               = 257;
  87. const GLFW_KEY_TAB                 = 258;
  88. const GLFW_KEY_BACKSPACE           = 259;
  89. const GLFW_KEY_INSERT              = 260;
  90. const GLFW_KEY_DELETE              = 261;
  91. const GLFW_KEY_RIGHT               = 262;
  92. const GLFW_KEY_LEFT                = 263;
  93. const GLFW_KEY_DOWN                = 264;
  94. const GLFW_KEY_UP                  = 265;
  95. const GLFW_KEY_PAGE_UP             = 266;
  96. const GLFW_KEY_PAGE_DOWN           = 267;
  97. const GLFW_KEY_HOME                = 268;
  98. const GLFW_KEY_END                 = 269;
  99. const GLFW_KEY_CAPS_LOCK           = 280;
  100. const GLFW_KEY_SCROLL_LOCK         = 281;
  101. const GLFW_KEY_NUM_LOCK            = 282;
  102. const GLFW_KEY_PRINT_SCREEN        = 283;
  103. const GLFW_KEY_PAUSE               = 284;
  104. const GLFW_KEY_F1                  = 290;
  105. const GLFW_KEY_F2                  = 291;
  106. const GLFW_KEY_F3                  = 292;
  107. const GLFW_KEY_F4                  = 293;
  108. const GLFW_KEY_F5                  = 294;
  109. const GLFW_KEY_F6                  = 295;
  110. const GLFW_KEY_F7                  = 296;
  111. const GLFW_KEY_F8                  = 297;
  112. const GLFW_KEY_F9                  = 298;
  113. const GLFW_KEY_F10                 = 299;
  114. const GLFW_KEY_F11                 = 300;
  115. const GLFW_KEY_F12                 = 301;
  116. const GLFW_KEY_F13                 = 302;
  117. const GLFW_KEY_F14                 = 303;
  118. const GLFW_KEY_F15                 = 304;
  119. const GLFW_KEY_F16                 = 305;
  120. const GLFW_KEY_F17                 = 306;
  121. const GLFW_KEY_F18                 = 307;
  122. const GLFW_KEY_F19                 = 308;
  123. const GLFW_KEY_F20                 = 309;
  124. const GLFW_KEY_F21                 = 310;
  125. const GLFW_KEY_F22                 = 311;
  126. const GLFW_KEY_F23                 = 312;
  127. const GLFW_KEY_F24                 = 313;
  128. const GLFW_KEY_F25                 = 314;
  129. const GLFW_KEY_KP_0                = 320;
  130. const GLFW_KEY_KP_1                = 321;
  131. const GLFW_KEY_KP_2                = 322;
  132. const GLFW_KEY_KP_3                = 323;
  133. const GLFW_KEY_KP_4                = 324;
  134. const GLFW_KEY_KP_5                = 325;
  135. const GLFW_KEY_KP_6                = 326;
  136. const GLFW_KEY_KP_7                = 327;
  137. const GLFW_KEY_KP_8                = 328;
  138. const GLFW_KEY_KP_9                = 329;
  139. const GLFW_KEY_KP_DECIMAL          = 330;
  140. const GLFW_KEY_KP_DIVIDE           = 331;
  141. const GLFW_KEY_KP_MULTIPLY         = 332;
  142. const GLFW_KEY_KP_SUBTRACT         = 333;
  143. const GLFW_KEY_KP_ADD              = 334;
  144. const GLFW_KEY_KP_ENTER            = 335;
  145. const GLFW_KEY_KP_EQUAL            = 336;
  146. const GLFW_KEY_LEFT_SHIFT          = 340;
  147. const GLFW_KEY_LEFT_CONTROL        = 341;
  148. const GLFW_KEY_LEFT_ALT            = 342;
  149. const GLFW_KEY_LEFT_SUPER          = 343;
  150. const GLFW_KEY_RIGHT_SHIFT         = 344;
  151. const GLFW_KEY_RIGHT_CONTROL       = 345;
  152. const GLFW_KEY_RIGHT_ALT           = 346;
  153. const GLFW_KEY_RIGHT_SUPER         = 347;
  154. const GLFW_KEY_MENU                = 348;
  155. const GLFW_KEY_LAST                = 348;
  156.  
  157. const GLFW_KEY_ESC                 = 256;
  158. const GLFW_KEY_DEL                 = 261;
  159. const GLFW_KEY_PAGEUP              = 266;
  160. const GLFW_KEY_PAGEDOWN            = 267;
  161. const GLFW_KEY_KP_NUM_LOCK         = 282;
  162. const GLFW_KEY_LCTRL               = 341;
  163. const GLFW_KEY_LSHIFT              = 340;
  164. const GLFW_KEY_LALT                = 342;
  165. const GLFW_KEY_LSUPER              = 343;
  166. const GLFW_KEY_RCTRL               = 345;
  167. const GLFW_KEY_RSHIFT              = 344;
  168. const GLFW_KEY_RALT                = 346;
  169. const GLFW_KEY_RSUPER              = 347;
  170.  
  171. const GLFW_MOUSE_BUTTON_1          = 0;
  172. const GLFW_MOUSE_BUTTON_2          = 1;
  173. const GLFW_MOUSE_BUTTON_3          = 2;
  174. const GLFW_MOUSE_BUTTON_4          = 3;
  175. const GLFW_MOUSE_BUTTON_5          = 4;
  176. const GLFW_MOUSE_BUTTON_6          = 5;
  177. const GLFW_MOUSE_BUTTON_7          = 6;
  178. const GLFW_MOUSE_BUTTON_8          = 7;
  179. const GLFW_MOUSE_BUTTON_LAST       = 7;
  180. const GLFW_MOUSE_BUTTON_LEFT       = 0;
  181. const GLFW_MOUSE_BUTTON_RIGHT      = 1;
  182. const GLFW_MOUSE_BUTTON_MIDDLE     = 3;
  183.  
  184. const GLFW_JOYSTICK_1              = 0;
  185. const GLFW_JOYSTICK_2              = 1;
  186. const GLFW_JOYSTICK_3              = 2;
  187. const GLFW_JOYSTICK_4              = 3;
  188. const GLFW_JOYSTICK_5              = 4;
  189. const GLFW_JOYSTICK_6              = 5;
  190. const GLFW_JOYSTICK_7              = 6;
  191. const GLFW_JOYSTICK_8              = 7;
  192. const GLFW_JOYSTICK_9              = 8;
  193. const GLFW_JOYSTICK_10             = 9;
  194. const GLFW_JOYSTICK_11             = 10;
  195. const GLFW_JOYSTICK_12             = 11;
  196. const GLFW_JOYSTICK_13             = 12;
  197. const GLFW_JOYSTICK_14             = 13;
  198. const GLFW_JOYSTICK_15             = 14;
  199. const GLFW_JOYSTICK_16             = 15;
  200. const GLFW_JOYSTICK_LAST           = 15;
  201.  
  202. const GLFW_NOT_INITIALIZED         = 0x00070001;
  203. const GLFW_NO_CURRENT_CONTEXT      = 0x00070002;
  204. const GLFW_INVALID_ENUM            = 0x00070003;
  205. const GLFW_INVALID_VALUE           = 0x00070004;
  206. const GLFW_OUT_OF_MEMORY           = 0x00070005;
  207. const GLFW_API_UNAVAILABLE         = 0x00070006;
  208. const GLFW_VERSION_UNAVAILABLE     = 0x00070007;
  209. const GLFW_PLATFORM_ERROR          = 0x00070008;
  210. const GLFW_FORMAT_UNAVAILABLE      = 0x00070009;
  211. const GLFW_FOCUSED                 = 0x00020001;
  212. const GLFW_ICONIFIED               = 0x00020002;
  213. const GLFW_RESIZABLE               = 0x00022007;
  214. const GLFW_VISIBLE                 = 0x00022008;
  215. const GLFW_DECORATED               = 0x00022009;
  216. const GLFW_CONTEXT_REVISION        = 0x00020004;
  217. const GLFW_RED_BITS                = 0x00021000;
  218. const GLFW_GREEN_BITS              = 0x00021001;
  219. const GLFW_BLUE_BITS               = 0x00021002;
  220. const GLFW_ALPHA_BITS              = 0x00021003;
  221. const GLFW_DEPTH_BITS              = 0x00021004;
  222. const GLFW_STENCIL_BITS            = 0x00021005;
  223. const GLFW_ACCUM_RED_BITS          = 0x00021006;
  224. const GLFW_ACCUM_GREEN_BITS        = 0x00021007;
  225. const GLFW_ACCUM_BLUE_BITS         = 0x00021008;
  226. const GLFW_ACCUM_ALPHA_BITS        = 0x00021009;
  227. const GLFW_AUX_BUFFERS             = 0x0002100A;
  228. const GLFW_STEREO                  = 0x0002100B;
  229. const GLFW_SAMPLES                 = 0x0002100C;
  230. const GLFW_SRGB_CAPABLE            = 0x0002100D;
  231.  
  232. const GLFW_CLIENT_API              = 0x00022000;
  233. const GLFW_CONTEXT_VERSION_MAJOR   = 0x00022001;
  234. const GLFW_CONTEXT_VERSION_MINOR   = 0x00022002;
  235. const GLFW_CONTEXT_ROBUSTNESS      = 0x00022003;
  236. const GLFW_OPENGL_FORWARD_COMPAT   = 0x00022004;
  237. const GLFW_OPENGL_DEBUG_CONTEXT    = 0x00022005;
  238. const GLFW_OPENGL_PROFILE          = 0x00022006;
  239.  
  240. const GLFW_OPENGL_API              = 0x00000001;
  241. const GLFW_OPENGL_ES_API           = 0x00000002;
  242.  
  243. const GLFW_NO_ROBUSTNESS           = 0x00000000;
  244. const GLFW_NO_RESET_NOTIFICATION   = 0x00000001;
  245. const GLFW_LOSE_CONTEXT_ON_RESET   = 0x00000002;
  246.  
  247. const GLFW_OPENGL_NO_PROFILE       = 0x00000000;
  248. const GLFW_OPENGL_CORE_PROFILE     = 0x00000001;
  249. const GLFW_OPENGL_COMPAT_PROFILE   = 0x00000002;
  250.  
  251. const GLFW_CURSOR_MODE             = 0x00030001;
  252. const GLFW_STICKY_KEYS             = 0x00030002;
  253. const GLFW_STICKY_MOUSE_BUTTONS    = 0x00030003;
  254.  
  255. const GLFW_CURSOR_NORMAL           = 0x00040001;
  256. const GLFW_CURSOR_HIDDEN           = 0x00040002;
  257. const GLFW_CURSOR_CAPTURED         = 0x00040003;
  258.  
  259. const GLFW_PRESENT                 = 0x00050001;
  260. const GLFW_AXES                    = 0x00050002;
  261. const GLFW_BUTTONS                 = 0x00050003;
  262.  
  263. const GLFW_GAMMA_RAMP_SIZE         = 256;
  264.  
  265. const GLFW_CONNECTED               = 0x00061000;
  266. const GLFW_DISCONNECTED            = 0x00061001;
  267.  
  268. struct GLFWmonitor tmp : char; end; // FIXME
  269. struct GLFWwindow  tmp : char; end; // FIXME
  270.  
  271. alias GLFWglproc           = def ();
  272. alias GLFWerrorfun         = def (a   : int; const msg : ^char);
  273. alias GLFWwindowposfun     = def (wnd : ^GLFWwindow; xpos, ypos : int);
  274. alias GLFWwindowsizefun    = def (wnd : ^GLFWwindow; width, height : int);
  275. alias GLFWwindowfocusfun   = def (wnd : ^GLFWwindow; focused : int);
  276. alias GLFWwindowiconifyfun = def (wnd : ^GLFWwindow; iconified : int);
  277. alias GLFWwindowclosefun   = def (wnd : ^GLFWwindow);
  278. alias GLFWwindowrefreshfun = def (wnd : ^GLFWwindow);
  279. alias GLFWmousebuttonfun   = def (wnd : ^GLFWwindow; button, action : int);
  280. alias GLFWmousebuttonfun   = def (wnd : ^GLFWwindow; xpos, ypos : double);
  281. alias GLFWcursorenterfun   = def (wnd : ^GLFWwindow; entered : int);
  282. alias GLFWscrollfun        = def (wnd : ^GLFWwindow; xpos, ypos : double);
  283. alias GLFWkeyfun           = def (wnd : ^GLFWwindow; key, action : int);
  284. alias GLFWcharfun          = def (wnd : ^GLFWwindow; character : cardinal);
  285. alias GLFWmonitorfun       = def (wnd : ^GLFWmonitor; event : int);
  286. alias GLFWcursorposfun     = def (wnd : ^GLFWwindow; xpos, ypos : double);
  287.  
  288. struct GLFWvidmode
  289.     width     : int;
  290.     height    : int;
  291.     redBits   : int;
  292.     greenBits : int;
  293.     blueBits  : int;
  294. end;
  295.  
  296. struct GLFWgammaramp
  297.     Red   : [256 x word];
  298.     Green : [256 x word];
  299.     Blue  : [256 x word];
  300. end;
  301.  
  302. def glfwInit () : int external;
  303. def glfwTerminate () external;
  304. def glfwGetVersion (major, minor, rev : ^int) external;
  305. def glfwGetVersionString : ^char external;
  306. def glfwSetErrorCallback (cbfun : GLFWerrorfun) : GLFWerrorfun external;
  307. def glfwGetMonitors (count : ^int) : ^^GLFWmonitor external;
  308. def glfwGetPrimaryMonitor() : ^GLFWmonitor external;
  309. def glfwGetMonitorPos (monitor : ^GLFWmonitor; xpos, ypos : ^int) external;
  310. def glfwGetMonitorPhysicalSize (monitor : ^GLFWmonitor; width, height : ^int) external;
  311. def glfwGetMonitorName (monitor : ^GLFWmonitor) : ^char external;
  312. def glfwSetMonitorCallback (cbfun : GLFWmonitorfun) : GLFWmonitorfun external;
  313. def glfwGetVideoModes (monitor : ^GLFWmonitor; count : ^int) : ^GLFWvidmode external;
  314. def glfwGetVideoMode (monitor : ^GLFWmonitor) : GLFWvidmode external;
  315. def glfwSetGamma (monitor : ^GLFWmonitor; gamma : float) external;
  316. def glfwGetGammaRamp (monitor : ^GLFWmonitor; ramp : ^GLFWgammaramp) external;
  317. def glfwSetGammaRamp (monitor : ^GLFWmonitor; const ramp : ^GLFWgammaramp) external;
  318. def glfwDefaultWindowHints () external;
  319. def glfwWindowHint (target, hint : int) external;
  320. def glfwCreateWindow (width, height : int; const title : ^char; monitor : ^GLFWmonitor; share : ^GLFWwindow) : ^GLFWwindow external;
  321. def glfwDestroyWindow (window : ^GLFWwindow) external;
  322. def glfwWindowShouldClose (window : ^GLFWwindow) : int external;
  323. def glfwSetWindowShouldClose (window : ^GLFWwindow; value : int) external;
  324. def glfwSetWindowTitle (window : ^GLFWwindow; const title : ^char) external;
  325. def glfwGetWindowPos (window : ^GLFWwindow; xpos, ypos : ^int) external;
  326. def glfwSetWindowPos (window : ^GLFWwindow; xpos, ypos : int) external;
  327. def glfwGetWindowSize (window : ^GLFWwindow; width, height : ^int) external;
  328. def glfwSetWindowSize (window : ^GLFWwindow; width, height : int) external;
  329. def glfwIconifyWindow (window : ^GLFWwindow) external;
  330. def glfwRestoreWindow (window : ^GLFWwindow) external;
  331. def glfwShowWindow (window : ^GLFWwindow) external;
  332. def glfwHideWindow (window : ^GLFWwindow) external;
  333. def glfwGetWindowMonitor (window : ^GLFWwindow) : ^GLFWmonitor external;
  334. def glfwGetWindowParam (window : ^GLFWwindow; param : int) : int external;
  335. def glfwSetWindowUserPointer (window : ^GLFWwindow; ptr : pointer) external;
  336. def glfwGetWindowUserPointer (window : ^GLFWwindow) : pointer external;
  337. def glfwSetWindowPosCallback (window : ^GLFWwindow; cbfun : GLFWwindowposfun) : GLFWwindowposfun external;
  338. def glfwSetWindowSizeCallback (window : ^GLFWwindow; cbfun : GLFWwindowsizefun) : GLFWwindowsizefun external;
  339. def glfwSetWindowCloseCallback (window : ^GLFWwindow; cbfun : GLFWwindowclosefun) : GLFWwindowclosefun external;
  340. def glfwSetWindowRefreshCallback (window : ^GLFWwindow; cbfun : GLFWwindowrefreshfun) : GLFWwindowrefreshfun external;
  341. def glfwSetWindowFocusCallback (window : ^GLFWwindow; cbfun : GLFWwindowfocusfun) : GLFWwindowfocusfun external;
  342. def glfwSetWindowIconifyCallback (window : ^GLFWwindow; cbfun : GLFWwindowiconifyfun) : GLFWwindowiconifyfun external;
  343. def glfwPollEvents () external;
  344. def glfwWaitEvents () external;
  345. def glfwGetInputMode (window : ^GLFWwindow; mode : int) : int external;
  346. def glfwSetInputMode (window : ^GLFWwindow; mode, value : int) external;
  347. def glfwGetKey (window : ^GLFWwindow; key : int) : int external;
  348. def glfwGetMouseButton (window : ^GLFWwindow; button : int) : int external;
  349. def glfwGetCursorPos (window : ^GLFWwindow; xpos, ypos : ^double) external;
  350. def glfwSetCursorPos (window : ^GLFWwindow; xpos, ypos : double) external;
  351. def glfwSetKeyCallback (window : ^GLFWwindow; cbfun : GLFWkeyfun) : GLFWkeyfun external;
  352. def glfwSetCharCallback (window : ^GLFWwindow; cbfun : GLFWcharfun) : GLFWcharfun external;
  353. def glfwSetMouseButtonCallback (window : ^GLFWwindow; cbfun : GLFWmousebuttonfun) : GLFWmousebuttonfun external;
  354. def glfwSetCursorPosCallback (window : ^GLFWwindow; cbfun : GLFWcursorposfun) : GLFWcursorposfun external;
  355. def glfwSetCursorEnterCallback (window : ^GLFWwindow; cbfun : GLFWcursorenterfun) : GLFWcursorenterfun external;
  356. def glfwSetScrollCallback (window : ^GLFWwindow; cbfun : GLFWscrollfun) : GLFWscrollfun external;
  357. def glfwGetJoystickParam (joy, param : int) : int external;
  358. def glfwGetJoystickAxes (joy : int; axes : ^float; numaxes : int) : int external;
  359. def glfwGetJoystickButtons (joy : int; buttons : ^char; numbuttons : int) : int external;
  360. def glfwGetJoystickName (joy : int) : ^char external;
  361. def glfwSetClipboardString (window : ^GLFWwindow; const str : ^char) external;
  362. def glfwGetClipboardString (window : ^GLFWwindow) : ^char external;
  363. def glfwGetTime : double external;
  364. def glfwSetTime (time : double) external;
  365. def glfwMakeContextCurrent (window : ^GLFWwindow) external;
  366. def glfwGetCurrentContext() : ^GLFWwindow external;
  367. def glfwSwapBuffers (window : ^GLFWwindow) external;
  368. def glfwSwapInterval (interval : int) external;
  369. def glfwExtensionSupported (const extension : ^char) : int external;
  370. def glfwGetProcAddress (const procname : ^char) : GLFWglproc external;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement