1 /************************************************************************ 2 * GLFW - An OpenGL framework 3 * API version: 2.7 4 * WWW: http://www.glfw.org/ 5 *------------------------------------------------------------------------ 6 * Copyright (c) 2002-2006 Marcus Geelnard 7 * Copyright (c) 2006-2010 Camilla Berglund 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 #ifndef __glfw_h_ 31 #define __glfw_h_ 32 33 #ifdef __cplusplus 34 extern "C" { 35 #endif 36 37 38 /************************************************************************* 39 * Global definitions 40 *************************************************************************/ 41 42 /* We need a NULL pointer from time to time */ 43 #ifndef NULL 44 #ifdef __cplusplus 45 #define NULL 0 46 #else 47 #define NULL ((void *)0) 48 #endif 49 #endif /* NULL */ 50 51 52 /* ------------------- BEGIN SYSTEM/COMPILER SPECIFIC -------------------- */ 53 54 /* Please report any probles that you find with your compiler, which may 55 * be solved in this section! There are several compilers that I have not 56 * been able to test this file with yet. 57 * 58 * First: If we are we on Windows, we want a single define for it (_WIN32) 59 * (Note: For Cygwin the compiler flag -mwin32 should be used, but to 60 * make sure that things run smoothly for Cygwin users, we add __CYGWIN__ 61 * to the list of "valid Win32 identifiers", which removes the need for 62 * -mwin32) 63 */ 64 #if !defined(_WIN32) && (defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__)) 65 #define _WIN32 66 #endif /* _WIN32 */ 67 68 /* In order for extension support to be portable, we need to define an 69 * OpenGL function call method. We use the keyword APIENTRY, which is 70 * defined for Win32. (Note: Windows also needs this for <GL/gl.h>) 71 */ 72 #ifndef APIENTRY 73 #ifdef _WIN32 74 #define APIENTRY __stdcall 75 #else 76 #define APIENTRY 77 #endif 78 #define GL_APIENTRY_DEFINED 79 #endif /* APIENTRY */ 80 81 82 /* The following three defines are here solely to make some Windows-based 83 * <GL/gl.h> files happy. Theoretically we could include <windows.h>, but 84 * it has the major drawback of severely polluting our namespace. 85 */ 86 87 /* Under Windows, we need WINGDIAPI defined */ 88 #if !defined(WINGDIAPI) && defined(_WIN32) 89 #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__POCC__) 90 /* Microsoft Visual C++, Borland C++ Builder and Pelles C */ 91 #define WINGDIAPI __declspec(dllimport) 92 #elif defined(__LCC__) 93 /* LCC-Win32 */ 94 #define WINGDIAPI __stdcall 95 #else 96 /* Others (e.g. MinGW, Cygwin) */ 97 #define WINGDIAPI extern 98 #endif 99 #define GL_WINGDIAPI_DEFINED 100 #endif /* WINGDIAPI */ 101 102 /* Some <GL/glu.h> files also need CALLBACK defined */ 103 #if !defined(CALLBACK) && defined(_WIN32) 104 #if defined(_MSC_VER) 105 /* Microsoft Visual C++ */ 106 #if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) 107 #define CALLBACK __stdcall 108 #else 109 #define CALLBACK 110 #endif 111 #else 112 /* Other Windows compilers */ 113 #define CALLBACK __stdcall 114 #endif 115 #define GLU_CALLBACK_DEFINED 116 #endif /* CALLBACK */ 117 118 /* Microsoft Visual C++, Borland C++ and Pelles C <GL*glu.h> needs wchar_t */ 119 #if defined(_WIN32) && (defined(_MSC_VER) || defined(__BORLANDC__) || defined(__POCC__)) && !defined(_WCHAR_T_DEFINED) 120 typedef unsigned short wchar_t; 121 #define _WCHAR_T_DEFINED 122 #endif /* _WCHAR_T_DEFINED */ 123 124 125 /* ---------------- GLFW related system specific defines ----------------- */ 126 127 #if defined(_WIN32) && defined(GLFW_BUILD_DLL) 128 129 /* We are building a Win32 DLL */ 130 #define GLFWAPI __declspec(dllexport) 131 #define GLFWAPIENTRY __stdcall 132 #define GLFWCALL __stdcall 133 134 #elif defined(_WIN32) && defined(GLFW_DLL) 135 136 /* We are calling a Win32 DLL */ 137 #if defined(__LCC__) 138 #define GLFWAPI extern 139 #else 140 #define GLFWAPI __declspec(dllimport) 141 #endif 142 #define GLFWAPIENTRY __stdcall 143 #define GLFWCALL __stdcall 144 145 #else 146 147 /* We are either building/calling a static lib or we are non-win32 */ 148 #define GLFWAPIENTRY 149 #define GLFWAPI 150 #define GLFWCALL 151 152 #endif 153 154 /* -------------------- END SYSTEM/COMPILER SPECIFIC --------------------- */ 155 156 /* Include standard OpenGL headers: GLFW uses GL_FALSE/GL_TRUE, and it is 157 * convenient for the user to only have to include <GL/glfw.h>. This also 158 * solves the problem with Windows <GL/gl.h> and <GL/glu.h> needing some 159 * special defines which normally requires the user to include <windows.h> 160 * (which is not a nice solution for portable programs). 161 */ 162 #if defined(__APPLE_CC__) 163 #if defined(GLFW_INCLUDE_GL3) 164 #include <OpenGL/gl3.h> 165 #else 166 #define GL_GLEXT_LEGACY 167 #include <OpenGL/gl.h> 168 #endif 169 #ifndef GLFW_NO_GLU 170 #include <OpenGL/glu.h> 171 #endif 172 #else 173 #if defined(GLFW_INCLUDE_GL3) 174 #include <GL3/gl3.h> 175 #else 176 #include <GL/gl.h> 177 #endif 178 #ifndef GLFW_NO_GLU 179 #include <GL/glu.h> 180 #endif 181 #endif 182 183 184 /************************************************************************* 185 * GLFW version 186 *************************************************************************/ 187 188 #define GLFW_VERSION_MAJOR 2 189 #define GLFW_VERSION_MINOR 7 190 #define GLFW_VERSION_REVISION 7 191 192 193 /************************************************************************* 194 * Input handling definitions 195 *************************************************************************/ 196 197 /* Key and button state/action definitions */ 198 #define GLFW_RELEASE 0 199 #define GLFW_PRESS 1 200 201 /* Keyboard key definitions: 8-bit ISO-8859-1 (Latin 1) encoding is used 202 * for printable keys (such as A-Z, 0-9 etc), and values above 256 203 * represent special (non-printable) keys (e.g. F1, Page Up etc). 204 */ 205 #define GLFW_KEY_UNKNOWN -1 206 #define GLFW_KEY_SPACE 32 207 #define GLFW_KEY_SPECIAL 256 208 #define GLFW_KEY_ESC (GLFW_KEY_SPECIAL+1) 209 #define GLFW_KEY_F1 (GLFW_KEY_SPECIAL+2) 210 #define GLFW_KEY_F2 (GLFW_KEY_SPECIAL+3) 211 #define GLFW_KEY_F3 (GLFW_KEY_SPECIAL+4) 212 #define GLFW_KEY_F4 (GLFW_KEY_SPECIAL+5) 213 #define GLFW_KEY_F5 (GLFW_KEY_SPECIAL+6) 214 #define GLFW_KEY_F6 (GLFW_KEY_SPECIAL+7) 215 #define GLFW_KEY_F7 (GLFW_KEY_SPECIAL+8) 216 #define GLFW_KEY_F8 (GLFW_KEY_SPECIAL+9) 217 #define GLFW_KEY_F9 (GLFW_KEY_SPECIAL+10) 218 #define GLFW_KEY_F10 (GLFW_KEY_SPECIAL+11) 219 #define GLFW_KEY_F11 (GLFW_KEY_SPECIAL+12) 220 #define GLFW_KEY_F12 (GLFW_KEY_SPECIAL+13) 221 #define GLFW_KEY_F13 (GLFW_KEY_SPECIAL+14) 222 #define GLFW_KEY_F14 (GLFW_KEY_SPECIAL+15) 223 #define GLFW_KEY_F15 (GLFW_KEY_SPECIAL+16) 224 #define GLFW_KEY_F16 (GLFW_KEY_SPECIAL+17) 225 #define GLFW_KEY_F17 (GLFW_KEY_SPECIAL+18) 226 #define GLFW_KEY_F18 (GLFW_KEY_SPECIAL+19) 227 #define GLFW_KEY_F19 (GLFW_KEY_SPECIAL+20) 228 #define GLFW_KEY_F20 (GLFW_KEY_SPECIAL+21) 229 #define GLFW_KEY_F21 (GLFW_KEY_SPECIAL+22) 230 #define GLFW_KEY_F22 (GLFW_KEY_SPECIAL+23) 231 #define GLFW_KEY_F23 (GLFW_KEY_SPECIAL+24) 232 #define GLFW_KEY_F24 (GLFW_KEY_SPECIAL+25) 233 #define GLFW_KEY_F25 (GLFW_KEY_SPECIAL+26) 234 #define GLFW_KEY_UP (GLFW_KEY_SPECIAL+27) 235 #define GLFW_KEY_DOWN (GLFW_KEY_SPECIAL+28) 236 #define GLFW_KEY_LEFT (GLFW_KEY_SPECIAL+29) 237 #define GLFW_KEY_RIGHT (GLFW_KEY_SPECIAL+30) 238 #define GLFW_KEY_LSHIFT (GLFW_KEY_SPECIAL+31) 239 #define GLFW_KEY_RSHIFT (GLFW_KEY_SPECIAL+32) 240 #define GLFW_KEY_LCTRL (GLFW_KEY_SPECIAL+33) 241 #define GLFW_KEY_RCTRL (GLFW_KEY_SPECIAL+34) 242 #define GLFW_KEY_LALT (GLFW_KEY_SPECIAL+35) 243 #define GLFW_KEY_RALT (GLFW_KEY_SPECIAL+36) 244 #define GLFW_KEY_TAB (GLFW_KEY_SPECIAL+37) 245 #define GLFW_KEY_ENTER (GLFW_KEY_SPECIAL+38) 246 #define GLFW_KEY_BACKSPACE (GLFW_KEY_SPECIAL+39) 247 #define GLFW_KEY_INSERT (GLFW_KEY_SPECIAL+40) 248 #define GLFW_KEY_DEL (GLFW_KEY_SPECIAL+41) 249 #define GLFW_KEY_PAGEUP (GLFW_KEY_SPECIAL+42) 250 #define GLFW_KEY_PAGEDOWN (GLFW_KEY_SPECIAL+43) 251 #define GLFW_KEY_HOME (GLFW_KEY_SPECIAL+44) 252 #define GLFW_KEY_END (GLFW_KEY_SPECIAL+45) 253 #define GLFW_KEY_KP_0 (GLFW_KEY_SPECIAL+46) 254 #define GLFW_KEY_KP_1 (GLFW_KEY_SPECIAL+47) 255 #define GLFW_KEY_KP_2 (GLFW_KEY_SPECIAL+48) 256 #define GLFW_KEY_KP_3 (GLFW_KEY_SPECIAL+49) 257 #define GLFW_KEY_KP_4 (GLFW_KEY_SPECIAL+50) 258 #define GLFW_KEY_KP_5 (GLFW_KEY_SPECIAL+51) 259 #define GLFW_KEY_KP_6 (GLFW_KEY_SPECIAL+52) 260 #define GLFW_KEY_KP_7 (GLFW_KEY_SPECIAL+53) 261 #define GLFW_KEY_KP_8 (GLFW_KEY_SPECIAL+54) 262 #define GLFW_KEY_KP_9 (GLFW_KEY_SPECIAL+55) 263 #define GLFW_KEY_KP_DIVIDE (GLFW_KEY_SPECIAL+56) 264 #define GLFW_KEY_KP_MULTIPLY (GLFW_KEY_SPECIAL+57) 265 #define GLFW_KEY_KP_SUBTRACT (GLFW_KEY_SPECIAL+58) 266 #define GLFW_KEY_KP_ADD (GLFW_KEY_SPECIAL+59) 267 #define GLFW_KEY_KP_DECIMAL (GLFW_KEY_SPECIAL+60) 268 #define GLFW_KEY_KP_EQUAL (GLFW_KEY_SPECIAL+61) 269 #define GLFW_KEY_KP_ENTER (GLFW_KEY_SPECIAL+62) 270 #define GLFW_KEY_KP_NUM_LOCK (GLFW_KEY_SPECIAL+63) 271 #define GLFW_KEY_CAPS_LOCK (GLFW_KEY_SPECIAL+64) 272 #define GLFW_KEY_SCROLL_LOCK (GLFW_KEY_SPECIAL+65) 273 #define GLFW_KEY_PAUSE (GLFW_KEY_SPECIAL+66) 274 #define GLFW_KEY_LSUPER (GLFW_KEY_SPECIAL+67) 275 #define GLFW_KEY_RSUPER (GLFW_KEY_SPECIAL+68) 276 #define GLFW_KEY_MENU (GLFW_KEY_SPECIAL+69) 277 #define GLFW_KEY_LAST GLFW_KEY_MENU 278 279 /* Mouse button definitions */ 280 #define GLFW_MOUSE_BUTTON_1 0 281 #define GLFW_MOUSE_BUTTON_2 1 282 #define GLFW_MOUSE_BUTTON_3 2 283 #define GLFW_MOUSE_BUTTON_4 3 284 #define GLFW_MOUSE_BUTTON_5 4 285 #define GLFW_MOUSE_BUTTON_6 5 286 #define GLFW_MOUSE_BUTTON_7 6 287 #define GLFW_MOUSE_BUTTON_8 7 288 #define GLFW_MOUSE_BUTTON_LAST GLFW_MOUSE_BUTTON_8 289 290 /* Mouse button aliases */ 291 #define GLFW_MOUSE_BUTTON_LEFT GLFW_MOUSE_BUTTON_1 292 #define GLFW_MOUSE_BUTTON_RIGHT GLFW_MOUSE_BUTTON_2 293 #define GLFW_MOUSE_BUTTON_MIDDLE GLFW_MOUSE_BUTTON_3 294 295 296 /* Joystick identifiers */ 297 #define GLFW_JOYSTICK_1 0 298 #define GLFW_JOYSTICK_2 1 299 #define GLFW_JOYSTICK_3 2 300 #define GLFW_JOYSTICK_4 3 301 #define GLFW_JOYSTICK_5 4 302 #define GLFW_JOYSTICK_6 5 303 #define GLFW_JOYSTICK_7 6 304 #define GLFW_JOYSTICK_8 7 305 #define GLFW_JOYSTICK_9 8 306 #define GLFW_JOYSTICK_10 9 307 #define GLFW_JOYSTICK_11 10 308 #define GLFW_JOYSTICK_12 11 309 #define GLFW_JOYSTICK_13 12 310 #define GLFW_JOYSTICK_14 13 311 #define GLFW_JOYSTICK_15 14 312 #define GLFW_JOYSTICK_16 15 313 #define GLFW_JOYSTICK_LAST GLFW_JOYSTICK_16 314 315 316 /************************************************************************* 317 * Other definitions 318 *************************************************************************/ 319 320 /* glfwOpenWindow modes */ 321 #define GLFW_WINDOW 0x00010001 322 #define GLFW_FULLSCREEN 0x00010002 323 324 /* glfwGetWindowParam tokens */ 325 #define GLFW_OPENED 0x00020001 326 #define GLFW_ACTIVE 0x00020002 327 #define GLFW_ICONIFIED 0x00020003 328 #define GLFW_ACCELERATED 0x00020004 329 #define GLFW_RED_BITS 0x00020005 330 #define GLFW_GREEN_BITS 0x00020006 331 #define GLFW_BLUE_BITS 0x00020007 332 #define GLFW_ALPHA_BITS 0x00020008 333 #define GLFW_DEPTH_BITS 0x00020009 334 #define GLFW_STENCIL_BITS 0x0002000A 335 336 /* The following constants are used for both glfwGetWindowParam 337 * and glfwOpenWindowHint 338 */ 339 #define GLFW_REFRESH_RATE 0x0002000B 340 #define GLFW_ACCUM_RED_BITS 0x0002000C 341 #define GLFW_ACCUM_GREEN_BITS 0x0002000D 342 #define GLFW_ACCUM_BLUE_BITS 0x0002000E 343 #define GLFW_ACCUM_ALPHA_BITS 0x0002000F 344 #define GLFW_AUX_BUFFERS 0x00020010 345 #define GLFW_STEREO 0x00020011 346 #define GLFW_WINDOW_NO_RESIZE 0x00020012 347 #define GLFW_FSAA_SAMPLES 0x00020013 348 #define GLFW_OPENGL_VERSION_MAJOR 0x00020014 349 #define GLFW_OPENGL_VERSION_MINOR 0x00020015 350 #define GLFW_OPENGL_FORWARD_COMPAT 0x00020016 351 #define GLFW_OPENGL_DEBUG_CONTEXT 0x00020017 352 #define GLFW_OPENGL_PROFILE 0x00020018 353 354 /* GLFW_OPENGL_PROFILE tokens */ 355 #define GLFW_OPENGL_CORE_PROFILE 0x00050001 356 #define GLFW_OPENGL_COMPAT_PROFILE 0x00050002 357 358 /* glfwEnable/glfwDisable tokens */ 359 #define GLFW_MOUSE_CURSOR 0x00030001 360 #define GLFW_STICKY_KEYS 0x00030002 361 #define GLFW_STICKY_MOUSE_BUTTONS 0x00030003 362 #define GLFW_SYSTEM_KEYS 0x00030004 363 #define GLFW_KEY_REPEAT 0x00030005 364 #define GLFW_AUTO_POLL_EVENTS 0x00030006 365 366 /* glfwWaitThread wait modes */ 367 #define GLFW_WAIT 0x00040001 368 #define GLFW_NOWAIT 0x00040002 369 370 /* glfwGetJoystickParam tokens */ 371 #define GLFW_PRESENT 0x00050001 372 #define GLFW_AXES 0x00050002 373 #define GLFW_BUTTONS 0x00050003 374 375 /* glfwReadImage/glfwLoadTexture2D flags */ 376 #define GLFW_NO_RESCALE_BIT 0x00000001 /* Only for glfwReadImage */ 377 #define GLFW_ORIGIN_UL_BIT 0x00000002 378 #define GLFW_BUILD_MIPMAPS_BIT 0x00000004 /* Only for glfwLoadTexture2D */ 379 #define GLFW_ALPHA_MAP_BIT 0x00000008 380 381 /* Time spans longer than this (seconds) are considered to be infinity */ 382 #define GLFW_INFINITY 100000.0 383 384 385 /************************************************************************* 386 * Typedefs 387 *************************************************************************/ 388 389 /* The video mode structure used by glfwGetVideoModes() */ 390 typedef struct { 391 int Width, Height; 392 int RedBits, BlueBits, GreenBits; 393 } GLFWvidmode; 394 395 /* Image/texture information */ 396 typedef struct { 397 int Width, Height; 398 int Format; 399 int BytesPerPixel; 400 unsigned char *Data; 401 } GLFWimage; 402 403 /* Thread ID */ 404 typedef int GLFWthread; 405 406 /* Mutex object */ 407 typedef void * GLFWmutex; 408 409 /* Condition variable object */ 410 typedef void * GLFWcond; 411 412 /* Function pointer types */ 413 typedef void (GLFWCALL * GLFWwindowsizefun)(int,int); 414 typedef int (GLFWCALL * GLFWwindowclosefun)(void); 415 typedef void (GLFWCALL * GLFWwindowrefreshfun)(void); 416 typedef void (GLFWCALL * GLFWmousebuttonfun)(int,int); 417 typedef void (GLFWCALL * GLFWmouseposfun)(int,int); 418 typedef void (GLFWCALL * GLFWmousewheelfun)(int); 419 typedef void (GLFWCALL * GLFWkeyfun)(int,int); 420 typedef void (GLFWCALL * GLFWcharfun)(int,int); 421 typedef void (GLFWCALL * GLFWthreadfun)(void *); 422 423 424 /************************************************************************* 425 * Prototypes 426 *************************************************************************/ 427 428 /* GLFW initialization, termination and version querying */ 429 GLFWAPI int GLFWAPIENTRY glfwInit( void ); 430 GLFWAPI void GLFWAPIENTRY glfwTerminate( void ); 431 GLFWAPI void GLFWAPIENTRY glfwGetVersion( int *major, int *minor, int *rev ); 432 433 /* Window handling */ 434 GLFWAPI int GLFWAPIENTRY glfwOpenWindow( int width, int height, int redbits, int greenbits, int bluebits, int alphabits, int depthbits, int stencilbits, int mode ); 435 GLFWAPI void GLFWAPIENTRY glfwOpenWindowHint( int target, int hint ); 436 GLFWAPI void GLFWAPIENTRY glfwCloseWindow( void ); 437 GLFWAPI void GLFWAPIENTRY glfwSetWindowTitle( const char *title ); 438 GLFWAPI void GLFWAPIENTRY glfwGetWindowSize( int *width, int *height ); 439 GLFWAPI void GLFWAPIENTRY glfwSetWindowSize( int width, int height ); 440 GLFWAPI void GLFWAPIENTRY glfwSetWindowPos( int x, int y ); 441 GLFWAPI void GLFWAPIENTRY glfwIconifyWindow( void ); 442 GLFWAPI void GLFWAPIENTRY glfwRestoreWindow( void ); 443 GLFWAPI void GLFWAPIENTRY glfwSwapBuffers( void ); 444 GLFWAPI void GLFWAPIENTRY glfwSwapInterval( int interval ); 445 GLFWAPI int GLFWAPIENTRY glfwGetWindowParam( int param ); 446 GLFWAPI void GLFWAPIENTRY glfwSetWindowSizeCallback( GLFWwindowsizefun cbfun ); 447 GLFWAPI void GLFWAPIENTRY glfwSetWindowCloseCallback( GLFWwindowclosefun cbfun ); 448 GLFWAPI void GLFWAPIENTRY glfwSetWindowRefreshCallback( GLFWwindowrefreshfun cbfun ); 449 450 /* Video mode functions */ 451 GLFWAPI int GLFWAPIENTRY glfwGetVideoModes( GLFWvidmode *list, int maxcount ); 452 GLFWAPI void GLFWAPIENTRY glfwGetDesktopMode( GLFWvidmode *mode ); 453 454 /* Input handling */ 455 GLFWAPI void GLFWAPIENTRY glfwPollEvents( void ); 456 GLFWAPI void GLFWAPIENTRY glfwWaitEvents( void ); 457 GLFWAPI int GLFWAPIENTRY glfwGetKey( int key ); 458 GLFWAPI int GLFWAPIENTRY glfwGetMouseButton( int button ); 459 GLFWAPI void GLFWAPIENTRY glfwGetMousePos( int *xpos, int *ypos ); 460 GLFWAPI void GLFWAPIENTRY glfwSetMousePos( int xpos, int ypos ); 461 GLFWAPI int GLFWAPIENTRY glfwGetMouseWheel( void ); 462 GLFWAPI void GLFWAPIENTRY glfwSetMouseWheel( int pos ); 463 GLFWAPI void GLFWAPIENTRY glfwSetKeyCallback( GLFWkeyfun cbfun ); 464 GLFWAPI void GLFWAPIENTRY glfwSetCharCallback( GLFWcharfun cbfun ); 465 GLFWAPI void GLFWAPIENTRY glfwSetMouseButtonCallback( GLFWmousebuttonfun cbfun ); 466 GLFWAPI void GLFWAPIENTRY glfwSetMousePosCallback( GLFWmouseposfun cbfun ); 467 GLFWAPI void GLFWAPIENTRY glfwSetMouseWheelCallback( GLFWmousewheelfun cbfun ); 468 469 /* Joystick input */ 470 GLFWAPI int GLFWAPIENTRY glfwGetJoystickParam( int joy, int param ); 471 GLFWAPI int GLFWAPIENTRY glfwGetJoystickPos( int joy, float *pos, int numaxes ); 472 GLFWAPI int GLFWAPIENTRY glfwGetJoystickButtons( int joy, unsigned char *buttons, int numbuttons ); 473 474 /* Time */ 475 GLFWAPI double GLFWAPIENTRY glfwGetTime( void ); 476 GLFWAPI void GLFWAPIENTRY glfwSetTime( double time ); 477 GLFWAPI void GLFWAPIENTRY glfwSleep( double time ); 478 479 /* Extension support */ 480 GLFWAPI int GLFWAPIENTRY glfwExtensionSupported( const char *extension ); 481 GLFWAPI void* GLFWAPIENTRY glfwGetProcAddress( const char *procname ); 482 GLFWAPI void GLFWAPIENTRY glfwGetGLVersion( int *major, int *minor, int *rev ); 483 484 /* Threading support */ 485 GLFWAPI GLFWthread GLFWAPIENTRY glfwCreateThread( GLFWthreadfun fun, void *arg ); 486 GLFWAPI void GLFWAPIENTRY glfwDestroyThread( GLFWthread ID ); 487 GLFWAPI int GLFWAPIENTRY glfwWaitThread( GLFWthread ID, int waitmode ); 488 GLFWAPI GLFWthread GLFWAPIENTRY glfwGetThreadID( void ); 489 GLFWAPI GLFWmutex GLFWAPIENTRY glfwCreateMutex( void ); 490 GLFWAPI void GLFWAPIENTRY glfwDestroyMutex( GLFWmutex mutex ); 491 GLFWAPI void GLFWAPIENTRY glfwLockMutex( GLFWmutex mutex ); 492 GLFWAPI void GLFWAPIENTRY glfwUnlockMutex( GLFWmutex mutex ); 493 GLFWAPI GLFWcond GLFWAPIENTRY glfwCreateCond( void ); 494 GLFWAPI void GLFWAPIENTRY glfwDestroyCond( GLFWcond cond ); 495 GLFWAPI void GLFWAPIENTRY glfwWaitCond( GLFWcond cond, GLFWmutex mutex, double timeout ); 496 GLFWAPI void GLFWAPIENTRY glfwSignalCond( GLFWcond cond ); 497 GLFWAPI void GLFWAPIENTRY glfwBroadcastCond( GLFWcond cond ); 498 GLFWAPI int GLFWAPIENTRY glfwGetNumberOfProcessors( void ); 499 500 /* Enable/disable functions */ 501 GLFWAPI void GLFWAPIENTRY glfwEnable( int token ); 502 GLFWAPI void GLFWAPIENTRY glfwDisable( int token ); 503 504 /* Image/texture I/O support */ 505 GLFWAPI int GLFWAPIENTRY glfwReadImage( const char *name, GLFWimage *img, int flags ); 506 GLFWAPI int GLFWAPIENTRY glfwReadMemoryImage( const void *data, long size, GLFWimage *img, int flags ); 507 GLFWAPI void GLFWAPIENTRY glfwFreeImage( GLFWimage *img ); 508 GLFWAPI int GLFWAPIENTRY glfwLoadTexture2D( const char *name, int flags ); 509 GLFWAPI int GLFWAPIENTRY glfwLoadMemoryTexture2D( const void *data, long size, int flags ); 510 GLFWAPI int GLFWAPIENTRY glfwLoadTextureImage2D( GLFWimage *img, int flags ); 511 512 513 #ifdef __cplusplus 514 } 515 #endif 516 517 #endif /* __glfw_h_ */ 518 519