sfml.js 0.0.1-preview.42 → 0.0.1-preview.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/README.md +24 -13
  2. package/binding.gyp +21 -19
  3. package/lib/poll_event.d.ts +2 -2
  4. package/lib/render_window.d.ts +36 -10
  5. package/lib/render_window.js +76 -0
  6. package/package.json +9 -17
  7. package/src/render_window.cc +177 -0
  8. package/src/render_window.h +45 -0
  9. package/src/render_window_async_display.cc +49 -0
  10. package/src/render_window_async_draw.cc +56 -0
  11. package/tools/copier/linux.js +21 -0
  12. package/tools/copier/macos.js +34 -0
  13. package/tools/copier/windows.js +33 -0
  14. package/tools/lib_downloader.js +102 -0
  15. package/tools/lib_downloader_urls.js +58 -0
  16. package/third_party/sfml/platform/linux/lib/libsfml-audio.so.2.5.1 +0 -0
  17. package/third_party/sfml/platform/linux/lib/libsfml-graphics.so.2.5.1 +0 -0
  18. package/third_party/sfml/platform/linux/lib/libsfml-network.so.2.5.1 +0 -0
  19. package/third_party/sfml/platform/linux/lib/libsfml-system.so.2.5.1 +0 -0
  20. package/third_party/sfml/platform/linux/lib/libsfml-window.so.2.5.1 +0 -0
  21. package/third_party/sfml/platform/macOS/Frameworks/FLAC.framework/Versions/A/FLAC +0 -0
  22. package/third_party/sfml/platform/macOS/Frameworks/FLAC.framework/Versions/A/Resources/Info.plist +0 -22
  23. package/third_party/sfml/platform/macOS/Frameworks/OpenAL.framework/Versions/A/OpenAL +0 -0
  24. package/third_party/sfml/platform/macOS/Frameworks/OpenAL.framework/Versions/A/Resources/Info.plist +0 -22
  25. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Audio/AlResource.hpp +0 -70
  26. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Audio/Export.hpp +0 -48
  27. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Audio/InputSoundFile.hpp +0 -263
  28. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Audio/Listener.hpp +0 -234
  29. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Audio/Music.hpp +0 -337
  30. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Audio/OutputSoundFile.hpp +0 -133
  31. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Audio/Sound.hpp +0 -264
  32. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Audio/SoundBuffer.hpp +0 -352
  33. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Audio/SoundBufferRecorder.hpp +0 -144
  34. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Audio/SoundFileFactory.hpp +0 -197
  35. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Audio/SoundFileFactory.inl +0 -100
  36. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Audio/SoundFileReader.hpp +0 -165
  37. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Audio/SoundFileWriter.hpp +0 -125
  38. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Audio/SoundRecorder.hpp +0 -408
  39. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Audio/SoundSource.hpp +0 -332
  40. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Audio/SoundStream.hpp +0 -405
  41. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Audio.hpp +0 -56
  42. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Config.hpp +0 -236
  43. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/GpuPreference.hpp +0 -74
  44. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/BlendMode.hpp +0 -215
  45. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/CircleShape.hpp +0 -154
  46. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/Color.hpp +0 -275
  47. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/ConvexShape.hpp +0 -153
  48. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/Drawable.hpp +0 -126
  49. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/Export.hpp +0 -48
  50. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/Font.hpp +0 -439
  51. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/Glsl.hpp +0 -227
  52. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/Glsl.inl +0 -155
  53. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/Glyph.hpp +0 -79
  54. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/Image.hpp +0 -324
  55. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/PrimitiveType.hpp +0 -58
  56. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/Rect.hpp +0 -254
  57. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/Rect.inl +0 -159
  58. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/RectangleShape.hpp +0 -132
  59. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/RenderStates.hpp +0 -174
  60. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/RenderTarget.hpp +0 -510
  61. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/RenderTexture.hpp +0 -314
  62. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/RenderWindow.hpp +0 -284
  63. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/Shader.hpp +0 -875
  64. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/Shape.hpp +0 -355
  65. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/Sprite.hpp +0 -279
  66. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/Text.hpp +0 -513
  67. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/Texture.hpp +0 -733
  68. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/Transform.hpp +0 -479
  69. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/Transformable.hpp +0 -429
  70. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/Vertex.hpp +0 -148
  71. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/VertexArray.hpp +0 -223
  72. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/VertexBuffer.hpp +0 -408
  73. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/View.hpp +0 -343
  74. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics.hpp +0 -68
  75. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Main.hpp +0 -43
  76. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Network/Export.hpp +0 -48
  77. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Network/Ftp.hpp +0 -616
  78. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Network/Http.hpp +0 -482
  79. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Network/IpAddress.hpp +0 -328
  80. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Network/Packet.hpp +0 -532
  81. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Network/Socket.hpp +0 -219
  82. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Network/SocketHandle.hpp +0 -57
  83. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Network/SocketSelector.hpp +0 -263
  84. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Network/TcpListener.hpp +0 -166
  85. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Network/TcpSocket.hpp +0 -316
  86. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Network/UdpSocket.hpp +0 -291
  87. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Network.hpp +0 -53
  88. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/OpenGL.hpp +0 -78
  89. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/Clock.hpp +0 -117
  90. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/Err.hpp +0 -80
  91. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/Export.hpp +0 -48
  92. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/FileInputStream.hpp +0 -169
  93. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/InputStream.hpp +0 -152
  94. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/Lock.hpp +0 -139
  95. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/MemoryInputStream.hpp +0 -148
  96. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/Mutex.hpp +0 -148
  97. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/NativeActivity.hpp +0 -62
  98. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/NonCopyable.hpp +0 -129
  99. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/Sleep.hpp +0 -52
  100. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/String.hpp +0 -669
  101. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/String.inl +0 -53
  102. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/Thread.hpp +0 -282
  103. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/Thread.inl +0 -90
  104. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/ThreadLocal.hpp +0 -103
  105. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/ThreadLocalPtr.hpp +0 -158
  106. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/ThreadLocalPtr.inl +0 -77
  107. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/Time.hpp +0 -488
  108. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/Utf.hpp +0 -763
  109. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/Utf.inl +0 -752
  110. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/Vector2.hpp +0 -301
  111. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/Vector2.inl +0 -161
  112. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/Vector3.hpp +0 -302
  113. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/Vector3.inl +0 -168
  114. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System.hpp +0 -60
  115. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Window/Clipboard.hpp +0 -119
  116. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Window/Context.hpp +0 -195
  117. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Window/ContextSettings.hpp +0 -149
  118. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Window/Cursor.hpp +0 -222
  119. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Window/Event.hpp +0 -284
  120. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Window/Export.hpp +0 -48
  121. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Window/GlResource.hpp +0 -109
  122. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Window/Joystick.hpp +0 -227
  123. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Window/Keyboard.hpp +0 -232
  124. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Window/Mouse.hpp +0 -177
  125. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Window/Sensor.hpp +0 -150
  126. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Window/Touch.hpp +0 -137
  127. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Window/VideoMode.hpp +0 -228
  128. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Window/Window.hpp +0 -622
  129. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Window/WindowHandle.hpp +0 -101
  130. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Window/WindowStyle.hpp +0 -53
  131. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Window.hpp +0 -58
  132. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Resources/CMake/SFMLConfig.cmake +0 -148
  133. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Resources/CMake/SFMLConfigDependencies.cmake +0 -86
  134. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Resources/CMake/SFMLConfigVersion.cmake +0 -46
  135. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Resources/CMake/SFMLSharedTargets-release.cmake +0 -59
  136. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Resources/CMake/SFMLSharedTargets.cmake +0 -158
  137. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/Resources/Info.plist +0 -26
  138. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/2.5.1/SFML +0 -0
  139. package/third_party/sfml/platform/macOS/Frameworks/freetype.framework/Versions/A/Resources/Info.plist +0 -22
  140. package/third_party/sfml/platform/macOS/Frameworks/freetype.framework/Versions/A/freetype +0 -0
  141. package/third_party/sfml/platform/macOS/Frameworks/ogg.framework/Versions/A/Resources/Info.plist +0 -22
  142. package/third_party/sfml/platform/macOS/Frameworks/ogg.framework/Versions/A/ogg +0 -0
  143. package/third_party/sfml/platform/macOS/Frameworks/sfml-audio.framework/Versions/2.5.1/Resources/Info.plist +0 -26
  144. package/third_party/sfml/platform/macOS/Frameworks/sfml-audio.framework/Versions/2.5.1/sfml-audio +0 -0
  145. package/third_party/sfml/platform/macOS/Frameworks/sfml-graphics.framework/Versions/2.5.1/Resources/Info.plist +0 -26
  146. package/third_party/sfml/platform/macOS/Frameworks/sfml-graphics.framework/Versions/2.5.1/sfml-graphics +0 -0
  147. package/third_party/sfml/platform/macOS/Frameworks/sfml-network.framework/Versions/2.5.1/Resources/Info.plist +0 -26
  148. package/third_party/sfml/platform/macOS/Frameworks/sfml-network.framework/Versions/2.5.1/sfml-network +0 -0
  149. package/third_party/sfml/platform/macOS/Frameworks/sfml-system.framework/Versions/2.5.1/Resources/Info.plist +0 -26
  150. package/third_party/sfml/platform/macOS/Frameworks/sfml-system.framework/Versions/2.5.1/sfml-system +0 -0
  151. package/third_party/sfml/platform/macOS/Frameworks/sfml-window.framework/Versions/2.5.1/Resources/Info.plist +0 -26
  152. package/third_party/sfml/platform/macOS/Frameworks/sfml-window.framework/Versions/2.5.1/sfml-window +0 -0
  153. package/third_party/sfml/platform/macOS/Frameworks/vorbis.framework/Versions/A/Resources/Info.plist +0 -22
  154. package/third_party/sfml/platform/macOS/Frameworks/vorbis.framework/Versions/A/vorbis +0 -0
  155. package/third_party/sfml/platform/macOS/Frameworks/vorbisenc.framework/Versions/A/Resources/Info.plist +0 -22
  156. package/third_party/sfml/platform/macOS/Frameworks/vorbisenc.framework/Versions/A/vorbisenc +0 -0
  157. package/third_party/sfml/platform/macOS/Frameworks/vorbisfile.framework/Versions/A/Resources/Info.plist +0 -22
  158. package/third_party/sfml/platform/macOS/Frameworks/vorbisfile.framework/Versions/A/vorbisfile +0 -0
  159. package/third_party/sfml/platform/macOS/lib/libsfml-audio.2.5.1.dylib +0 -0
  160. package/third_party/sfml/platform/macOS/lib/libsfml-graphics.2.5.1.dylib +0 -0
  161. package/third_party/sfml/platform/macOS/lib/libsfml-network.2.5.1.dylib +0 -0
  162. package/third_party/sfml/platform/macOS/lib/libsfml-system.2.5.1.dylib +0 -0
  163. package/third_party/sfml/platform/macOS/lib/libsfml-window.2.5.1.dylib +0 -0
  164. package/third_party/sfml/platform/win64/bin/openal32.dll +0 -0
  165. package/third_party/sfml/platform/win64/bin/sfml-audio-2.dll +0 -0
  166. package/third_party/sfml/platform/win64/bin/sfml-graphics-2.dll +0 -0
  167. package/third_party/sfml/platform/win64/bin/sfml-network-2.dll +0 -0
  168. package/third_party/sfml/platform/win64/bin/sfml-system-2.dll +0 -0
  169. package/third_party/sfml/platform/win64/bin/sfml-window-2.dll +0 -0
  170. package/third_party/sfml/platform/win64/lib/flac.lib +0 -0
  171. package/third_party/sfml/platform/win64/lib/freetype.lib +0 -0
  172. package/third_party/sfml/platform/win64/lib/ogg.lib +0 -0
  173. package/third_party/sfml/platform/win64/lib/openal32.lib +0 -0
  174. package/third_party/sfml/platform/win64/lib/sfml-audio.lib +0 -0
  175. package/third_party/sfml/platform/win64/lib/sfml-graphics.lib +0 -0
  176. package/third_party/sfml/platform/win64/lib/sfml-main.lib +0 -0
  177. package/third_party/sfml/platform/win64/lib/sfml-network.lib +0 -0
  178. package/third_party/sfml/platform/win64/lib/sfml-system.lib +0 -0
  179. package/third_party/sfml/platform/win64/lib/sfml-window.lib +0 -0
  180. package/third_party/sfml/platform/win64/lib/vorbis.lib +0 -0
  181. package/third_party/sfml/platform/win64/lib/vorbisenc.lib +0 -0
  182. package/third_party/sfml/platform/win64/lib/vorbisfile.lib +0 -0
  183. package/tools/symlinks.js +0 -122
@@ -0,0 +1,49 @@
1
+ #include "render_window.h"
2
+
3
+ namespace node_sfml {
4
+ namespace render_window {
5
+
6
+ AsyncRenderWindowDisplay::AsyncRenderWindowDisplay(
7
+ sf::RenderWindow* window,
8
+ sf::Mutex* display_draw_mutex,
9
+ Nan::Callback* callback)
10
+ : Nan::AsyncWorker(callback) {
11
+ this->_window = window;
12
+ this->_display_draw_mutex = display_draw_mutex;
13
+ }
14
+
15
+ void AsyncRenderWindowDisplay::Execute() {
16
+ if (this->_window == nullptr) {
17
+ this->SetErrorMessage("No window provided!");
18
+ return;
19
+ }
20
+ if (!this->_window->isOpen()) {
21
+ this->SetErrorMessage("Closed window.");
22
+ return;
23
+ }
24
+
25
+ this->_display_draw_mutex->lock();
26
+ this->_window->setActive(true);
27
+ this->_window->display();
28
+ this->_window->setActive(false);
29
+ this->_display_draw_mutex->unlock();
30
+ }
31
+
32
+ void AsyncRenderWindowDisplay::HandleOKCallback() {
33
+ Nan::HandleScope scope;
34
+ v8::Local<v8::Value> argv[] = {Nan::Null(), // no error occured
35
+ Nan::Null()};
36
+ Nan::Call(
37
+ callback->GetFunction(), Nan::GetCurrentContext()->Global(), 2, argv);
38
+ }
39
+
40
+ void AsyncRenderWindowDisplay::HandleErrorCallback() {
41
+ Nan::HandleScope scope;
42
+ v8::Local<v8::Value> argv[] = {
43
+ Nan::New(this->ErrorMessage()).ToLocalChecked(), // return error message
44
+ Nan::Null()};
45
+ Nan::Call(
46
+ callback->GetFunction(), Nan::GetCurrentContext()->Global(), 2, argv);
47
+ }
48
+ } // namespace render_window
49
+ } // namespace node_sfml
@@ -0,0 +1,56 @@
1
+ #include "render_window.h"
2
+
3
+ namespace node_sfml {
4
+ namespace render_window {
5
+
6
+ AsyncRenderWindowDraw::AsyncRenderWindowDraw(sf::RenderWindow* window,
7
+ sf::Mutex* display_draw_mutex,
8
+ sf::Drawable* drawable,
9
+ sf::RenderStates* render_states,
10
+ Nan::Callback* callback)
11
+ : Nan::AsyncWorker(callback) {
12
+ this->_window = window;
13
+ this->_display_draw_mutex = display_draw_mutex;
14
+ this->_drawable = drawable;
15
+ this->_render_states = render_states;
16
+ }
17
+
18
+ void AsyncRenderWindowDraw::Execute() {
19
+ if (this->_window == nullptr) {
20
+ this->SetErrorMessage("No window provided!");
21
+ return;
22
+ }
23
+ if (!this->_window->isOpen()) {
24
+ this->SetErrorMessage("Closed window.");
25
+ return;
26
+ }
27
+
28
+ this->_display_draw_mutex->lock();
29
+ this->_window->setActive(true);
30
+ if (this->_render_states == nullptr) {
31
+ this->_window->draw(*this->_drawable);
32
+ } else {
33
+ this->_window->draw(*this->_drawable, *this->_render_states);
34
+ }
35
+ this->_window->setActive(false);
36
+ this->_display_draw_mutex->unlock();
37
+ }
38
+
39
+ void AsyncRenderWindowDraw::HandleOKCallback() {
40
+ Nan::HandleScope scope;
41
+ v8::Local<v8::Value> argv[] = {Nan::Null(), // no error occured
42
+ Nan::Null()};
43
+ Nan::Call(
44
+ callback->GetFunction(), Nan::GetCurrentContext()->Global(), 2, argv);
45
+ }
46
+
47
+ void AsyncRenderWindowDraw::HandleErrorCallback() {
48
+ Nan::HandleScope scope;
49
+ v8::Local<v8::Value> argv[] = {
50
+ Nan::New(this->ErrorMessage()).ToLocalChecked(), // return error message
51
+ Nan::Null()};
52
+ Nan::Call(
53
+ callback->GetFunction(), Nan::GetCurrentContext()->Global(), 2, argv);
54
+ }
55
+ } // namespace render_window
56
+ } // namespace node_sfml
@@ -0,0 +1,21 @@
1
+ 'use strict';
2
+
3
+ const fs = require('fs').promises;
4
+ const path = require('path');
5
+
6
+ const baseDir = path.join(__dirname, '../../dest');
7
+ const targetDir = path.join(__dirname, '../../third_party/sfml/platform/linux');
8
+
9
+ exports.move = async function move(spinner) {
10
+ spinner.start('Moving SFML files...');
11
+ await fs.rm(targetDir, { recursive: true, force: true });
12
+ await fs.mkdir(targetDir, { recursive: true });
13
+
14
+ const srcLibDir = path.join(baseDir, 'lib');
15
+ const destLibDir = path.join(targetDir, 'lib');
16
+ await fs.rename(srcLibDir, destLibDir);
17
+
18
+ await fs.rm(path.join(destLibDir, 'cmake'), { recursive: true, force: true });
19
+
20
+ spinner.stop(`[sfml.js] SFML files moved to ${destLibDir}.`);
21
+ };
@@ -0,0 +1,34 @@
1
+ 'use strict';
2
+
3
+ const fs = require('fs').promises;
4
+ const path = require('path');
5
+
6
+ const baseDir = path.join(__dirname, '../../dest');
7
+ const targetDir = path.join(__dirname, '../../third_party/sfml/platform/macOS');
8
+
9
+ exports.move = async function move(spinner) {
10
+ spinner.start('Moving SFML files...');
11
+ await fs.rm(targetDir, { recursive: true, force: true });
12
+ await fs.mkdir(targetDir, { recursive: true });
13
+
14
+ const srcFrameworksDir = path.join(baseDir, 'Frameworks');
15
+ const destFrameworksDir = path.join(targetDir, 'Frameworks');
16
+ await fs.rename(srcFrameworksDir, destFrameworksDir);
17
+
18
+ const srcExtlibsDir = path.join(baseDir, 'extlibs');
19
+ const extlibs = await fs.readdir(srcExtlibsDir);
20
+ for (const extlib of extlibs) {
21
+ const srcExtlibDir = path.join(srcExtlibsDir, extlib);
22
+ if (!(await fs.stat(srcExtlibDir)).isDirectory()) {
23
+ continue;
24
+ }
25
+
26
+ const destExtlibDir = path.join(destFrameworksDir, extlib);
27
+ await fs.rename(srcExtlibDir, destExtlibDir);
28
+ }
29
+
30
+ const srcLibDir = path.join(baseDir, 'lib');
31
+ const destLibDir = path.join(targetDir, 'lib');
32
+ await fs.rename(srcLibDir, destLibDir);
33
+ spinner.stop(`[sfml.js] SFML files moved to ${destLibDir}.`);
34
+ };
@@ -0,0 +1,33 @@
1
+ 'use strict';
2
+
3
+ const fs = require('fs').promises;
4
+ const path = require('path');
5
+
6
+ const baseDir = path.join(__dirname, '../../dest');
7
+ const targetDir = path.join(__dirname, '../../third_party/sfml/platform/win');
8
+
9
+ exports.move = async function move(spinner) {
10
+ spinner.start('Moving SFML files...');
11
+ await fs.rm(targetDir, { recursive: true, force: true });
12
+ await fs.mkdir(targetDir, { recursive: true });
13
+
14
+ const srcLibDir = path.join(baseDir, 'lib');
15
+ const destLibDir = path.join(targetDir, 'lib');
16
+ const moves = [];
17
+ const libs = await fs.readdir(srcLibDir);
18
+ await fs.mkdir(destLibDir, { recursive: true });
19
+ for (const lib of libs) {
20
+ // TODO(XadillaX): Use `-d.lib` if Debug.
21
+ if (lib.endsWith('.lib') && !lib.endsWith('-d.lib')) {
22
+ moves.push(
23
+ fs.rename(path.join(srcLibDir, lib), path.join(destLibDir, lib)));
24
+ }
25
+ }
26
+ await Promise.all(moves);
27
+
28
+ const srcBinDir = path.join(baseDir, 'bin');
29
+ const destBinDir = path.join(targetDir, 'bin');
30
+ await fs.rename(srcBinDir, destBinDir);
31
+
32
+ spinner.stop(`[sfml.js] SFML files moved to ${destLibDir}.`);
33
+ };
@@ -0,0 +1,102 @@
1
+ 'use strict';
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const os = require('os');
6
+
7
+ const download = require('download');
8
+ const Spinner = require('tiny-spinner');
9
+
10
+ const urls = require('./lib_downloader_urls');
11
+
12
+ const spinner = new Spinner();
13
+ const platform = os.platform();
14
+ let type;
15
+
16
+ switch (platform) {
17
+ case 'darwin': {
18
+ if (process.arch !== 'x64') {
19
+ throw new Error('Unsupported architecture: ' + process.arch);
20
+ }
21
+
22
+ type = 'macOS';
23
+ break;
24
+ }
25
+
26
+ case 'aix':
27
+ case 'freebsd':
28
+ case 'netbsd':
29
+ case 'openbsd':
30
+ case 'sunos':
31
+ case 'linux': {
32
+ if (process.arch !== 'x64') {
33
+ throw new Error('Unsupported architecture: ' + process.arch);
34
+ }
35
+
36
+ type = 'linux';
37
+ break;
38
+ }
39
+
40
+ case 'win32': {
41
+ if (process.arch === 'x64') {
42
+ type = 'win64';
43
+ } else if (process.arch === 'ia32') {
44
+ type = 'win32';
45
+ } else {
46
+ throw new Error('Unsupported architecture: ' + process.arch);
47
+ }
48
+
49
+ break;
50
+ }
51
+
52
+ default:
53
+ throw new Error('Unsupported platform: ' + platform);
54
+ }
55
+
56
+ async function downloadTarball(url) {
57
+ spinner.start(`Downloading and extracting ${url}...`);
58
+
59
+ await download(url, path.join(__dirname, '../dest'), {
60
+ extract: true,
61
+ strip: 1,
62
+ });
63
+
64
+ spinner.stop(`[sfml.js] ${url} Downloaded.`);
65
+ }
66
+
67
+ (async () => {
68
+ fs.rmSync(path.join(__dirname, '../dest'), { recursive: true, force: true });
69
+ fs.rmSync(
70
+ path.join(__dirname, '../third_party/sfml/platform/macOS'),
71
+ { recursive: true, force: true });
72
+ fs.rmSync(
73
+ path.join(__dirname, '../third_party/sfml/platform/linux'),
74
+ { recursive: true, force: true });
75
+ fs.rmSync(
76
+ path.join(__dirname, '../third_party/sfml/platform/win'),
77
+ { recursive: true, force: true });
78
+
79
+ await downloadTarball((await urls.get())[type]);
80
+ let copier;
81
+ switch (type) {
82
+ case 'macOS':
83
+ copier = require('./copier/macos');
84
+ break;
85
+
86
+ case 'linux':
87
+ copier = require('./copier/linux');
88
+ break;
89
+
90
+ case 'win64':
91
+ case 'win32':
92
+ copier = require('./copier/windows');
93
+ break;
94
+
95
+ default:
96
+ throw new Error('Unsupported platform: ' + platform);
97
+ }
98
+
99
+ await copier.move(spinner);
100
+
101
+ fs.rmSync(path.join(__dirname, '../dest'), { recursive: true, force: true });
102
+ })();
@@ -0,0 +1,58 @@
1
+ 'use strict';
2
+
3
+ const spidex = require('spidex');
4
+
5
+ const urls = {
6
+ macOS:
7
+ 'https://github.com/SFML/SFML/releases/download/2.5.1/SFML-2.5.1-' +
8
+ 'macOS-clang.tar.gz',
9
+ linux:
10
+ 'https://github.com/SFML/SFML/releases/download/2.5.1/SFML-2.5.1-linux-' +
11
+ 'gcc-64-bit.tar.gz',
12
+ win32:
13
+ 'https://github.com/SFML/SFML/releases/download/2.5.1/SFML-2.5.1-' +
14
+ 'windows-vc15-32-bit.zip',
15
+ win64:
16
+ 'https://github.com/SFML/SFML/releases/download/2.5.1/SFML-2.5.1-' +
17
+ 'windows-vc15-64-bit.zip',
18
+ };
19
+
20
+ exports.get = async function get() {
21
+ let resolve;
22
+ const promise = new Promise(res => {
23
+ resolve = res;
24
+ });
25
+
26
+ spidex.get('https://ip.tool.lu/', (content, status) => {
27
+ if (status !== 200) {
28
+ console.warn(
29
+ '[sfml.js] Failed to get ip address, fallback to original ' +
30
+ 'download URL.');
31
+ resolve(urls);
32
+ return;
33
+ }
34
+
35
+ // https://doc.fastgit.org/zh-cn/guide.html
36
+ console.log(content);
37
+ if (content.includes('中国')) {
38
+ for (const key in urls) {
39
+ if (!urls.hasOwnProperty(key)) {
40
+ continue;
41
+ }
42
+
43
+ urls[key] = urls[key].replace(
44
+ 'https://github.com/',
45
+ 'https://download.fastgit.org/');
46
+ }
47
+ }
48
+
49
+ resolve(urls);
50
+ }).on('error', err => {
51
+ console.warn(
52
+ `[sfml.js] Cannot get your location with IP (${err.message})` +
53
+ ', fallback to original download URL.');
54
+ resolve(urls);
55
+ });
56
+
57
+ return promise;
58
+ };
@@ -1,22 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>CFBundleDevelopmentRegion</key>
6
- <string>English</string>
7
- <key>CFBundleExecutable</key>
8
- <string>FLAC</string>
9
- <key>CFBundleIdentifier</key>
10
- <string>org.sfml-dev.FLAC</string>
11
- <key>CFBundleInfoDictionaryVersion</key>
12
- <string>6.0</string>
13
- <key>CFBundlePackageType</key>
14
- <string>FMWK</string>
15
- <key>CFBundleSignature</key>
16
- <string>????</string>
17
- <key>CFBundleVersion</key>
18
- <string>1.0</string>
19
- <key>CFBundleSupportedPlatforms</key>
20
- <array><string>MacOSX</string></array>
21
- </dict>
22
- </plist>
@@ -1,22 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>CFBundleDevelopmentRegion</key>
6
- <string>English</string>
7
- <key>CFBundleExecutable</key>
8
- <string>OpenAL</string>
9
- <key>CFBundleIdentifier</key>
10
- <string>org.sfml-dev.OpenAL</string>
11
- <key>CFBundleInfoDictionaryVersion</key>
12
- <string>6.0</string>
13
- <key>CFBundlePackageType</key>
14
- <string>FMWK</string>
15
- <key>CFBundleSignature</key>
16
- <string>????</string>
17
- <key>CFBundleVersion</key>
18
- <string>1.0</string>
19
- <key>CFBundleSupportedPlatforms</key>
20
- <array><string>MacOSX</string></array>
21
- </dict>
22
- </plist>
@@ -1,70 +0,0 @@
1
- ////////////////////////////////////////////////////////////
2
- //
3
- // SFML - Simple and Fast Multimedia Library
4
- // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org)
5
- //
6
- // This software is provided 'as-is', without any express or implied warranty.
7
- // In no event will the authors be held liable for any damages arising from the use of this software.
8
- //
9
- // Permission is granted to anyone to use this software for any purpose,
10
- // including commercial applications, and to alter it and redistribute it freely,
11
- // subject to the following restrictions:
12
- //
13
- // 1. The origin of this software must not be misrepresented;
14
- // you must not claim that you wrote the original software.
15
- // If you use this software in a product, an acknowledgment
16
- // in the product documentation would be appreciated but is not required.
17
- //
18
- // 2. Altered source versions must be plainly marked as such,
19
- // and must not be misrepresented as being the original software.
20
- //
21
- // 3. This notice may not be removed or altered from any source distribution.
22
- //
23
- ////////////////////////////////////////////////////////////
24
-
25
- #ifndef SFML_ALRESOURCE_HPP
26
- #define SFML_ALRESOURCE_HPP
27
-
28
- ////////////////////////////////////////////////////////////
29
- // Headers
30
- ////////////////////////////////////////////////////////////
31
- #include <SFML/Audio/Export.hpp>
32
-
33
-
34
- namespace sf
35
- {
36
- ////////////////////////////////////////////////////////////
37
- /// \brief Base class for classes that require an OpenAL context
38
- ///
39
- ////////////////////////////////////////////////////////////
40
- class SFML_AUDIO_API AlResource
41
- {
42
- protected:
43
-
44
- ////////////////////////////////////////////////////////////
45
- /// \brief Default constructor
46
- ///
47
- ////////////////////////////////////////////////////////////
48
- AlResource();
49
-
50
- ////////////////////////////////////////////////////////////
51
- /// \brief Destructor
52
- ///
53
- ////////////////////////////////////////////////////////////
54
- ~AlResource();
55
- };
56
-
57
- } // namespace sf
58
-
59
-
60
- #endif // SFML_ALRESOURCE_HPP
61
-
62
- ////////////////////////////////////////////////////////////
63
- /// \class sf::AlResource
64
- /// \ingroup audio
65
- ///
66
- /// This class is for internal use only, it must be the base
67
- /// of every class that requires a valid OpenAL context in
68
- /// order to work.
69
- ///
70
- ////////////////////////////////////////////////////////////
@@ -1,48 +0,0 @@
1
- ////////////////////////////////////////////////////////////
2
- //
3
- // SFML - Simple and Fast Multimedia Library
4
- // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org)
5
- //
6
- // This software is provided 'as-is', without any express or implied warranty.
7
- // In no event will the authors be held liable for any damages arising from the use of this software.
8
- //
9
- // Permission is granted to anyone to use this software for any purpose,
10
- // including commercial applications, and to alter it and redistribute it freely,
11
- // subject to the following restrictions:
12
- //
13
- // 1. The origin of this software must not be misrepresented;
14
- // you must not claim that you wrote the original software.
15
- // If you use this software in a product, an acknowledgment
16
- // in the product documentation would be appreciated but is not required.
17
- //
18
- // 2. Altered source versions must be plainly marked as such,
19
- // and must not be misrepresented as being the original software.
20
- //
21
- // 3. This notice may not be removed or altered from any source distribution.
22
- //
23
- ////////////////////////////////////////////////////////////
24
-
25
- #ifndef SFML_AUDIO_EXPORT_HPP
26
- #define SFML_AUDIO_EXPORT_HPP
27
-
28
- ////////////////////////////////////////////////////////////
29
- // Headers
30
- ////////////////////////////////////////////////////////////
31
- #include <SFML/Config.hpp>
32
-
33
-
34
- ////////////////////////////////////////////////////////////
35
- // Define portable import / export macros
36
- ////////////////////////////////////////////////////////////
37
- #if defined(SFML_AUDIO_EXPORTS)
38
-
39
- #define SFML_AUDIO_API SFML_API_EXPORT
40
-
41
- #else
42
-
43
- #define SFML_AUDIO_API SFML_API_IMPORT
44
-
45
- #endif
46
-
47
-
48
- #endif // SFML_AUDIO_EXPORT_HPP