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.

148 lines
5.9 KiB

преди 7 години
преди 5 години
преди 7 години
преди 11 месеца
преди 7 години
преди 3 години
преди 7 години
преди 2 години
преди 7 години
преди 7 години
преди 7 години
преди 7 години
преди 3 години
преди 2 години
преди 7 години
преди 7 години
преди 7 години
преди 1 година
преди 7 години
преди 7 години
преди 2 години
преди 1 година
преди 1 година
преди 7 години
преди 7 години
преди 7 години
преди 7 години
преди 1 година
преди 7 години
преди 7 години
преди 7 години
преди 7 години
преди 7 години
преди 1 година
преди 7 години
  1. /**********************************************************************************************
  2. *
  3. * rglfw - raylib GLFW single file compilation
  4. *
  5. * This file includes latest GLFW sources (https://github.com/glfw/glfw) to be compiled together
  6. * with raylib for all supported platforms, this way, no external dependencies are required.
  7. *
  8. * LICENSE: zlib/libpng
  9. *
  10. * Copyright (c) 2017-2024 Ramon Santamaria (@raysan5)
  11. *
  12. * This software is provided "as-is", without any express or implied warranty. In no event
  13. * will the authors be held liable for any damages arising from the use of this software.
  14. *
  15. * Permission is granted to anyone to use this software for any purpose, including commercial
  16. * applications, and to alter it and redistribute it freely, subject to the following restrictions:
  17. *
  18. * 1. The origin of this software must not be misrepresented; you must not claim that you
  19. * wrote the original software. If you use this software in a product, an acknowledgment
  20. * in the product documentation would be appreciated but is not required.
  21. *
  22. * 2. Altered source versions must be plainly marked as such, and must not be misrepresented
  23. * as being the original software.
  24. *
  25. * 3. This notice may not be removed or altered from any source distribution.
  26. *
  27. **********************************************************************************************/
  28. //#define _GLFW_BUILD_DLL // To build shared version
  29. // Ref: http://www.glfw.org/docs/latest/compile.html#compile_manual
  30. // Platform options:
  31. // _GLFW_WIN32 to use the Win32 API
  32. // _GLFW_X11 to use the X Window System
  33. // _GLFW_WAYLAND to use the Wayland API (experimental and incomplete)
  34. // _GLFW_COCOA to use the Cocoa frameworks
  35. //
  36. // On Linux, _GLFW_X11 and _GLFW_WAYLAND can be combined
  37. //----------------------------------------------------------------------------------
  38. // Feature Test Macros required for this module
  39. //----------------------------------------------------------------------------------
  40. #if (defined(__linux__) || defined(PLATFORM_WEB)) && (_POSIX_C_SOURCE < 199309L)
  41. #undef _POSIX_C_SOURCE
  42. #define _POSIX_C_SOURCE 199309L // Required for: CLOCK_MONOTONIC if compiled with c99 without gnu ext.
  43. #endif
  44. #if (defined(__linux__) || defined(PLATFORM_WEB)) && !defined(_GNU_SOURCE)
  45. #undef _GNU_SOURCE
  46. #define _GNU_SOURCE // Required for: ppoll if compiled with c99 without gnu ext.
  47. #endif
  48. #if defined(_WIN32) || defined(__CYGWIN__)
  49. #define _GLFW_WIN32
  50. #endif
  51. #if defined(__linux__)
  52. #if !defined(_GLFW_WAYLAND) && !defined(_GLFW_X11)
  53. #error "Cannot disable Wayland and X11 at the same time"
  54. #endif
  55. #endif
  56. #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
  57. #define _GLFW_X11
  58. #endif
  59. #if defined(__APPLE__)
  60. #define _GLFW_COCOA
  61. #define _GLFW_USE_MENUBAR // To create and populate the menu bar when the first window is created
  62. #define _GLFW_USE_RETINA // To have windows use the full resolution of Retina displays
  63. #endif
  64. #if defined(__TINYC__)
  65. #define _WIN32_WINNT_WINXP 0x0501
  66. #endif
  67. // Common modules to all platforms
  68. #include "external/glfw/src/init.c"
  69. #include "external/glfw/src/platform.c"
  70. #include "external/glfw/src/context.c"
  71. #include "external/glfw/src/monitor.c"
  72. #include "external/glfw/src/window.c"
  73. #include "external/glfw/src/input.c"
  74. #include "external/glfw/src/vulkan.c"
  75. #if defined(_WIN32) || defined(__CYGWIN__)
  76. #include "external/glfw/src/win32_init.c"
  77. #include "external/glfw/src/win32_module.c"
  78. #include "external/glfw/src/win32_monitor.c"
  79. #include "external/glfw/src/win32_window.c"
  80. #include "external/glfw/src/win32_joystick.c"
  81. #include "external/glfw/src/win32_time.c"
  82. #include "external/glfw/src/win32_thread.c"
  83. #include "external/glfw/src/wgl_context.c"
  84. #include "external/glfw/src/egl_context.c"
  85. #include "external/glfw/src/osmesa_context.c"
  86. #endif
  87. #if defined(__linux__)
  88. #include "external/glfw/src/posix_module.c"
  89. #include "external/glfw/src/posix_thread.c"
  90. #include "external/glfw/src/posix_time.c"
  91. #include "external/glfw/src/posix_poll.c"
  92. #include "external/glfw/src/linux_joystick.c"
  93. #include "external/glfw/src/xkb_unicode.c"
  94. #include "external/glfw/src/egl_context.c"
  95. #include "external/glfw/src/osmesa_context.c"
  96. #if defined(_GLFW_WAYLAND)
  97. #include "external/glfw/src/wl_init.c"
  98. #include "external/glfw/src/wl_monitor.c"
  99. #include "external/glfw/src/wl_window.c"
  100. #endif
  101. #if defined(_GLFW_X11)
  102. #include "external/glfw/src/x11_init.c"
  103. #include "external/glfw/src/x11_monitor.c"
  104. #include "external/glfw/src/x11_window.c"
  105. #include "external/glfw/src/glx_context.c"
  106. #endif
  107. #endif
  108. #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined( __NetBSD__) || defined(__DragonFly__)
  109. #include "external/glfw/src/posix_module.c"
  110. #include "external/glfw/src/posix_thread.c"
  111. #include "external/glfw/src/posix_time.c"
  112. #include "external/glfw/src/posix_poll.c"
  113. #include "external/glfw/src/null_joystick.c"
  114. #include "external/glfw/src/xkb_unicode.c"
  115. #include "external/glfw/src/x11_init.c"
  116. #include "external/glfw/src/x11_monitor.c"
  117. #include "external/glfw/src/x11_window.c"
  118. #include "external/glfw/src/glx_context.c"
  119. #include "external/glfw/src/egl_context.c"
  120. #include "external/glfw/src/osmesa_context.c"
  121. #endif
  122. #if defined(__APPLE__)
  123. #include "external/glfw/src/posix_module.c"
  124. #include "external/glfw/src/posix_thread.c"
  125. #include "external/glfw/src/cocoa_init.m"
  126. #include "external/glfw/src/cocoa_joystick.m"
  127. #include "external/glfw/src/cocoa_monitor.m"
  128. #include "external/glfw/src/cocoa_window.m"
  129. #include "external/glfw/src/cocoa_time.c"
  130. #include "external/glfw/src/nsgl_context.m"
  131. #include "external/glfw/src/egl_context.c"
  132. #include "external/glfw/src/osmesa_context.c"
  133. #endif