sfml.js 0.0.1-preview.37 → 0.0.1-preview.40

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 (319) hide show
  1. package/README.md +2 -4
  2. package/binding.gyp +31 -0
  3. package/lib/color.js +5 -2
  4. package/lib/image.js +17 -4
  5. package/lib/keyboard.js +3 -1
  6. package/lib/rect.js +28 -8
  7. package/lib/render_window.js +3 -1
  8. package/lib/texture.d.ts +1 -0
  9. package/lib/texture.js +19 -0
  10. package/lib/vector2.js +26 -12
  11. package/lib/vertex.js +4 -2
  12. package/lib/video_mode.js +14 -4
  13. package/package.json +8 -3
  14. package/src/color.cc +4 -6
  15. package/src/drawable/package_plugin-inl.h +4 -3
  16. package/src/drawable/rectangle_shape.cc +3 -2
  17. package/src/drawable/shape.cc +3 -1
  18. package/src/drawable/vertex_array.cc +3 -3
  19. package/src/font.cc +6 -4
  20. package/src/image.cc +4 -5
  21. package/src/image.h +1 -1
  22. package/src/mouse.cc +2 -1
  23. package/src/plugins/transformable_plugin-inl.h +2 -2
  24. package/src/rect-inl.h +12 -8
  25. package/src/rect.h +1 -1
  26. package/src/render_window.cc +4 -3
  27. package/src/resizable_buffer.h +17 -2
  28. package/src/texture.cc +46 -2
  29. package/src/texture.h +1 -0
  30. package/src/utils-inl.h +2 -2
  31. package/src/vector2-inl.h +13 -13
  32. package/src/vector2.h +3 -3
  33. package/src/vertex.cc +66 -28
  34. package/src/vertex.h +2 -2
  35. package/third_party/sfml/platform/macOS/Frameworks/FLAC.framework/Resources/Info.plist +22 -0
  36. package/third_party/sfml/platform/macOS/Frameworks/FLAC.framework/Versions/Current/FLAC +0 -0
  37. package/third_party/sfml/platform/macOS/Frameworks/FLAC.framework/Versions/Current/Resources/Info.plist +22 -0
  38. package/third_party/sfml/platform/macOS/Frameworks/OpenAL.framework/Resources/Info.plist +22 -0
  39. package/third_party/sfml/platform/macOS/Frameworks/OpenAL.framework/Versions/Current/OpenAL +0 -0
  40. package/third_party/sfml/platform/macOS/Frameworks/OpenAL.framework/Versions/Current/Resources/Info.plist +22 -0
  41. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/AlResource.hpp +70 -0
  42. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/Export.hpp +48 -0
  43. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/InputSoundFile.hpp +263 -0
  44. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/Listener.hpp +234 -0
  45. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/Music.hpp +337 -0
  46. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/OutputSoundFile.hpp +133 -0
  47. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/Sound.hpp +264 -0
  48. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/SoundBuffer.hpp +352 -0
  49. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/SoundBufferRecorder.hpp +144 -0
  50. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/SoundFileFactory.hpp +197 -0
  51. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/SoundFileFactory.inl +100 -0
  52. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/SoundFileReader.hpp +165 -0
  53. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/SoundFileWriter.hpp +125 -0
  54. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/SoundRecorder.hpp +408 -0
  55. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/SoundSource.hpp +332 -0
  56. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/SoundStream.hpp +405 -0
  57. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio.hpp +56 -0
  58. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Config.hpp +236 -0
  59. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/GpuPreference.hpp +74 -0
  60. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/BlendMode.hpp +215 -0
  61. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/CircleShape.hpp +154 -0
  62. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Color.hpp +275 -0
  63. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/ConvexShape.hpp +153 -0
  64. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Drawable.hpp +126 -0
  65. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Export.hpp +48 -0
  66. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Font.hpp +439 -0
  67. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Glsl.hpp +227 -0
  68. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Glsl.inl +155 -0
  69. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Glyph.hpp +79 -0
  70. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Image.hpp +324 -0
  71. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/PrimitiveType.hpp +58 -0
  72. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Rect.hpp +254 -0
  73. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Rect.inl +159 -0
  74. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/RectangleShape.hpp +132 -0
  75. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/RenderStates.hpp +174 -0
  76. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/RenderTarget.hpp +510 -0
  77. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/RenderTexture.hpp +314 -0
  78. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/RenderWindow.hpp +284 -0
  79. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Shader.hpp +875 -0
  80. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Shape.hpp +355 -0
  81. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Sprite.hpp +279 -0
  82. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Text.hpp +513 -0
  83. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Texture.hpp +733 -0
  84. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Transform.hpp +479 -0
  85. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Transformable.hpp +429 -0
  86. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Vertex.hpp +148 -0
  87. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/VertexArray.hpp +223 -0
  88. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/VertexBuffer.hpp +408 -0
  89. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/View.hpp +343 -0
  90. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics.hpp +68 -0
  91. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Main.hpp +43 -0
  92. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network/Export.hpp +48 -0
  93. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network/Ftp.hpp +616 -0
  94. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network/Http.hpp +482 -0
  95. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network/IpAddress.hpp +328 -0
  96. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network/Packet.hpp +532 -0
  97. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network/Socket.hpp +219 -0
  98. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network/SocketHandle.hpp +57 -0
  99. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network/SocketSelector.hpp +263 -0
  100. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network/TcpListener.hpp +166 -0
  101. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network/TcpSocket.hpp +316 -0
  102. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network/UdpSocket.hpp +291 -0
  103. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network.hpp +53 -0
  104. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/OpenGL.hpp +78 -0
  105. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Clock.hpp +117 -0
  106. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Err.hpp +80 -0
  107. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Export.hpp +48 -0
  108. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/FileInputStream.hpp +169 -0
  109. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/InputStream.hpp +152 -0
  110. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Lock.hpp +139 -0
  111. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/MemoryInputStream.hpp +148 -0
  112. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Mutex.hpp +148 -0
  113. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/NativeActivity.hpp +62 -0
  114. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/NonCopyable.hpp +129 -0
  115. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Sleep.hpp +52 -0
  116. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/String.hpp +669 -0
  117. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/String.inl +53 -0
  118. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Thread.hpp +282 -0
  119. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Thread.inl +90 -0
  120. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/ThreadLocal.hpp +103 -0
  121. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/ThreadLocalPtr.hpp +158 -0
  122. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/ThreadLocalPtr.inl +77 -0
  123. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Time.hpp +488 -0
  124. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Utf.hpp +763 -0
  125. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Utf.inl +752 -0
  126. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Vector2.hpp +301 -0
  127. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Vector2.inl +161 -0
  128. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Vector3.hpp +302 -0
  129. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Vector3.inl +168 -0
  130. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System.hpp +60 -0
  131. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/Clipboard.hpp +119 -0
  132. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/Context.hpp +195 -0
  133. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/ContextSettings.hpp +149 -0
  134. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/Cursor.hpp +222 -0
  135. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/Event.hpp +284 -0
  136. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/Export.hpp +48 -0
  137. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/GlResource.hpp +109 -0
  138. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/Joystick.hpp +227 -0
  139. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/Keyboard.hpp +232 -0
  140. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/Mouse.hpp +177 -0
  141. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/Sensor.hpp +150 -0
  142. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/Touch.hpp +137 -0
  143. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/VideoMode.hpp +228 -0
  144. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/Window.hpp +622 -0
  145. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/WindowHandle.hpp +101 -0
  146. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/WindowStyle.hpp +53 -0
  147. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window.hpp +58 -0
  148. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Resources/CMake/SFMLConfig.cmake +148 -0
  149. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Resources/CMake/SFMLConfigDependencies.cmake +86 -0
  150. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Resources/CMake/SFMLConfigVersion.cmake +46 -0
  151. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Resources/CMake/SFMLSharedTargets-release.cmake +59 -0
  152. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Resources/CMake/SFMLSharedTargets.cmake +158 -0
  153. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Resources/Info.plist +26 -0
  154. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/AlResource.hpp +70 -0
  155. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/Export.hpp +48 -0
  156. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/InputSoundFile.hpp +263 -0
  157. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/Listener.hpp +234 -0
  158. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/Music.hpp +337 -0
  159. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/OutputSoundFile.hpp +133 -0
  160. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/Sound.hpp +264 -0
  161. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/SoundBuffer.hpp +352 -0
  162. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/SoundBufferRecorder.hpp +144 -0
  163. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/SoundFileFactory.hpp +197 -0
  164. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/SoundFileFactory.inl +100 -0
  165. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/SoundFileReader.hpp +165 -0
  166. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/SoundFileWriter.hpp +125 -0
  167. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/SoundRecorder.hpp +408 -0
  168. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/SoundSource.hpp +332 -0
  169. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/SoundStream.hpp +405 -0
  170. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio.hpp +56 -0
  171. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Config.hpp +236 -0
  172. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/GpuPreference.hpp +74 -0
  173. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/BlendMode.hpp +215 -0
  174. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/CircleShape.hpp +154 -0
  175. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Color.hpp +275 -0
  176. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/ConvexShape.hpp +153 -0
  177. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Drawable.hpp +126 -0
  178. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Export.hpp +48 -0
  179. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Font.hpp +439 -0
  180. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Glsl.hpp +227 -0
  181. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Glsl.inl +155 -0
  182. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Glyph.hpp +79 -0
  183. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Image.hpp +324 -0
  184. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/PrimitiveType.hpp +58 -0
  185. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Rect.hpp +254 -0
  186. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Rect.inl +159 -0
  187. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/RectangleShape.hpp +132 -0
  188. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/RenderStates.hpp +174 -0
  189. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/RenderTarget.hpp +510 -0
  190. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/RenderTexture.hpp +314 -0
  191. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/RenderWindow.hpp +284 -0
  192. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Shader.hpp +875 -0
  193. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Shape.hpp +355 -0
  194. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Sprite.hpp +279 -0
  195. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Text.hpp +513 -0
  196. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Texture.hpp +733 -0
  197. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Transform.hpp +479 -0
  198. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Transformable.hpp +429 -0
  199. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Vertex.hpp +148 -0
  200. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/VertexArray.hpp +223 -0
  201. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/VertexBuffer.hpp +408 -0
  202. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/View.hpp +343 -0
  203. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics.hpp +68 -0
  204. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Main.hpp +43 -0
  205. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network/Export.hpp +48 -0
  206. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network/Ftp.hpp +616 -0
  207. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network/Http.hpp +482 -0
  208. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network/IpAddress.hpp +328 -0
  209. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network/Packet.hpp +532 -0
  210. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network/Socket.hpp +219 -0
  211. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network/SocketHandle.hpp +57 -0
  212. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network/SocketSelector.hpp +263 -0
  213. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network/TcpListener.hpp +166 -0
  214. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network/TcpSocket.hpp +316 -0
  215. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network/UdpSocket.hpp +291 -0
  216. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network.hpp +53 -0
  217. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/OpenGL.hpp +78 -0
  218. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Clock.hpp +117 -0
  219. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Err.hpp +80 -0
  220. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Export.hpp +48 -0
  221. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/FileInputStream.hpp +169 -0
  222. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/InputStream.hpp +152 -0
  223. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Lock.hpp +139 -0
  224. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/MemoryInputStream.hpp +148 -0
  225. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Mutex.hpp +148 -0
  226. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/NativeActivity.hpp +62 -0
  227. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/NonCopyable.hpp +129 -0
  228. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Sleep.hpp +52 -0
  229. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/String.hpp +669 -0
  230. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/String.inl +53 -0
  231. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Thread.hpp +282 -0
  232. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Thread.inl +90 -0
  233. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/ThreadLocal.hpp +103 -0
  234. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/ThreadLocalPtr.hpp +158 -0
  235. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/ThreadLocalPtr.inl +77 -0
  236. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Time.hpp +488 -0
  237. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Utf.hpp +763 -0
  238. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Utf.inl +752 -0
  239. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Vector2.hpp +301 -0
  240. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Vector2.inl +161 -0
  241. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Vector3.hpp +302 -0
  242. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Vector3.inl +168 -0
  243. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System.hpp +60 -0
  244. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/Clipboard.hpp +119 -0
  245. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/Context.hpp +195 -0
  246. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/ContextSettings.hpp +149 -0
  247. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/Cursor.hpp +222 -0
  248. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/Event.hpp +284 -0
  249. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/Export.hpp +48 -0
  250. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/GlResource.hpp +109 -0
  251. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/Joystick.hpp +227 -0
  252. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/Keyboard.hpp +232 -0
  253. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/Mouse.hpp +177 -0
  254. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/Sensor.hpp +150 -0
  255. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/Touch.hpp +137 -0
  256. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/VideoMode.hpp +228 -0
  257. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/Window.hpp +622 -0
  258. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/WindowHandle.hpp +101 -0
  259. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/WindowStyle.hpp +53 -0
  260. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window.hpp +58 -0
  261. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Resources/CMake/SFMLConfig.cmake +148 -0
  262. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Resources/CMake/SFMLConfigDependencies.cmake +86 -0
  263. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Resources/CMake/SFMLConfigVersion.cmake +46 -0
  264. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Resources/CMake/SFMLSharedTargets-release.cmake +59 -0
  265. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Resources/CMake/SFMLSharedTargets.cmake +158 -0
  266. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Resources/Info.plist +26 -0
  267. package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/SFML +0 -0
  268. package/third_party/sfml/platform/macOS/Frameworks/freetype.framework/Resources/Info.plist +22 -0
  269. package/third_party/sfml/platform/macOS/Frameworks/freetype.framework/Versions/Current/Resources/Info.plist +22 -0
  270. package/third_party/sfml/platform/macOS/Frameworks/freetype.framework/Versions/Current/freetype +0 -0
  271. package/third_party/sfml/platform/macOS/Frameworks/ogg.framework/Resources/Info.plist +22 -0
  272. package/third_party/sfml/platform/macOS/Frameworks/ogg.framework/Versions/Current/Resources/Info.plist +22 -0
  273. package/third_party/sfml/platform/macOS/Frameworks/ogg.framework/Versions/Current/ogg +0 -0
  274. package/third_party/sfml/platform/macOS/Frameworks/sfml-audio.framework/Resources/Info.plist +26 -0
  275. package/third_party/sfml/platform/macOS/Frameworks/sfml-audio.framework/Versions/Current/Resources/Info.plist +26 -0
  276. package/third_party/sfml/platform/macOS/Frameworks/sfml-audio.framework/Versions/Current/sfml-audio +0 -0
  277. package/third_party/sfml/platform/macOS/Frameworks/sfml-graphics.framework/Resources/Info.plist +26 -0
  278. package/third_party/sfml/platform/macOS/Frameworks/sfml-graphics.framework/Versions/Current/Resources/Info.plist +26 -0
  279. package/third_party/sfml/platform/macOS/Frameworks/sfml-graphics.framework/Versions/Current/sfml-graphics +0 -0
  280. package/third_party/sfml/platform/macOS/Frameworks/sfml-network.framework/Resources/Info.plist +26 -0
  281. package/third_party/sfml/platform/macOS/Frameworks/sfml-network.framework/Versions/Current/Resources/Info.plist +26 -0
  282. package/third_party/sfml/platform/macOS/Frameworks/sfml-network.framework/Versions/Current/sfml-network +0 -0
  283. package/third_party/sfml/platform/macOS/Frameworks/sfml-system.framework/Resources/Info.plist +26 -0
  284. package/third_party/sfml/platform/macOS/Frameworks/sfml-system.framework/Versions/Current/Resources/Info.plist +26 -0
  285. package/third_party/sfml/platform/macOS/Frameworks/sfml-system.framework/Versions/Current/sfml-system +0 -0
  286. package/third_party/sfml/platform/macOS/Frameworks/sfml-window.framework/Resources/Info.plist +26 -0
  287. package/third_party/sfml/platform/macOS/Frameworks/sfml-window.framework/Versions/Current/Resources/Info.plist +26 -0
  288. package/third_party/sfml/platform/macOS/Frameworks/sfml-window.framework/Versions/Current/sfml-window +0 -0
  289. package/third_party/sfml/platform/macOS/Frameworks/vorbis.framework/Resources/Info.plist +22 -0
  290. package/third_party/sfml/platform/macOS/Frameworks/vorbis.framework/Versions/Current/Resources/Info.plist +22 -0
  291. package/third_party/sfml/platform/macOS/Frameworks/vorbis.framework/Versions/Current/vorbis +0 -0
  292. package/third_party/sfml/platform/macOS/Frameworks/vorbisenc.framework/Resources/Info.plist +22 -0
  293. package/third_party/sfml/platform/macOS/Frameworks/vorbisenc.framework/Versions/Current/Resources/Info.plist +22 -0
  294. package/third_party/sfml/platform/macOS/Frameworks/vorbisenc.framework/Versions/Current/vorbisenc +0 -0
  295. package/third_party/sfml/platform/macOS/Frameworks/vorbisfile.framework/Resources/Info.plist +22 -0
  296. package/third_party/sfml/platform/macOS/Frameworks/vorbisfile.framework/Versions/Current/Resources/Info.plist +22 -0
  297. package/third_party/sfml/platform/macOS/Frameworks/vorbisfile.framework/Versions/Current/vorbisfile +0 -0
  298. package/third_party/sfml/platform/win64/bin/openal32.dll +0 -0
  299. package/third_party/sfml/platform/win64/bin/sfml-audio-2.dll +0 -0
  300. package/third_party/sfml/platform/win64/bin/sfml-graphics-2.dll +0 -0
  301. package/third_party/sfml/platform/win64/bin/sfml-network-2.dll +0 -0
  302. package/third_party/sfml/platform/win64/bin/sfml-system-2.dll +0 -0
  303. package/third_party/sfml/platform/win64/bin/sfml-window-2.dll +0 -0
  304. package/third_party/sfml/platform/win64/lib/flac.lib +0 -0
  305. package/third_party/sfml/platform/win64/lib/freetype.lib +0 -0
  306. package/third_party/sfml/platform/win64/lib/ogg.lib +0 -0
  307. package/third_party/sfml/platform/win64/lib/openal32.lib +0 -0
  308. package/third_party/sfml/platform/win64/lib/sfml-audio.lib +0 -0
  309. package/third_party/sfml/platform/win64/lib/sfml-graphics.lib +0 -0
  310. package/third_party/sfml/platform/win64/lib/sfml-main.lib +0 -0
  311. package/third_party/sfml/platform/win64/lib/sfml-network.lib +0 -0
  312. package/third_party/sfml/platform/win64/lib/sfml-system.lib +0 -0
  313. package/third_party/sfml/platform/win64/lib/sfml-window.lib +0 -0
  314. package/third_party/sfml/platform/win64/lib/vorbis.lib +0 -0
  315. package/third_party/sfml/platform/win64/lib/vorbisenc.lib +0 -0
  316. package/third_party/sfml/platform/win64/lib/vorbisfile.lib +0 -0
  317. package/tools/keycode.js +31 -20
  318. package/tools/mouse_button.js +52 -35
  319. package/tools/symlinks.js +15 -0
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ![](https://www.sfml-dev.org/images/logo.png)
4
4
 
5
- SFML's Node.js binding.
5
+ A cross-platform SFML's Node.js binding.
6
6
 
7
7
  > Under developing.
8
8
 
@@ -10,6 +10,4 @@ SFML's Node.js binding.
10
10
 
11
11
  ```bash
12
12
  $ node-gyp rebuild
13
- ```
14
-
15
- > Current only support Linux and macOS.
13
+ ```
package/binding.gyp CHANGED
@@ -57,6 +57,37 @@
57
57
  "../third_party/sfml/platform/linux/lib/libsfml-graphics.so"
58
58
  ]
59
59
  }],
60
+ ["OS==\"win\"", {
61
+ "defines": [
62
+ "NOMINMAX"
63
+ ],
64
+ "copies": [{
65
+ "destination": "<(module_root_dir)/build/Release/",
66
+ "files": [
67
+ "<(module_root_dir)/third_party/sfml/platform/win64/bin/openal32.dll",
68
+ "<(module_root_dir)/third_party/sfml/platform/win64/bin/sfml-audio-2.dll",
69
+ "<(module_root_dir)/third_party/sfml/platform/win64/bin/sfml-graphics-2.dll",
70
+ "<(module_root_dir)/third_party/sfml/platform/win64/bin/sfml-network-2.dll",
71
+ "<(module_root_dir)/third_party/sfml/platform/win64/bin/sfml-system-2.dll",
72
+ "<(module_root_dir)/third_party/sfml/platform/win64/bin/sfml-window-2.dll"
73
+ ]
74
+ }],
75
+ "libraries": [
76
+ "../third_party/sfml/platform/win64/lib/flac.lib",
77
+ "../third_party/sfml/platform/win64/lib/freetype.lib",
78
+ "../third_party/sfml/platform/win64/lib/ogg.lib",
79
+ "../third_party/sfml/platform/win64/lib/openal32.lib",
80
+ "../third_party/sfml/platform/win64/lib/sfml-audio.lib",
81
+ "../third_party/sfml/platform/win64/lib/sfml-graphics.lib",
82
+ "../third_party/sfml/platform/win64/lib/sfml-main.lib",
83
+ "../third_party/sfml/platform/win64/lib/sfml-network.lib",
84
+ "../third_party/sfml/platform/win64/lib/sfml-system.lib",
85
+ "../third_party/sfml/platform/win64/lib/sfml-window.lib",
86
+ "../third_party/sfml/platform/win64/lib/vorbis.lib",
87
+ "../third_party/sfml/platform/win64/lib/vorbisenc.lib",
88
+ "../third_party/sfml/platform/win64/lib/vorbisfile.lib",
89
+ ],
90
+ }],
60
91
  ["OS==\"mac\"", {
61
92
  "libraries": [
62
93
  "../third_party/sfml/platform/macOS/lib/libsfml-audio.dylib",
package/lib/color.js CHANGED
@@ -2,7 +2,10 @@
2
2
 
3
3
  const util = require('util');
4
4
 
5
- const { Color: _Color, setRealColorConstructor } = require('../build/Release/binding.node');
5
+ const {
6
+ Color: _Color,
7
+ setRealColorConstructor,
8
+ } = require('../build/Release/binding.node');
6
9
  const { validateTypeOf } = require('./common');
7
10
 
8
11
  const TO_INTEGER = Symbol('Color::toInteger');
@@ -90,6 +93,6 @@ class Color extends _Color {
90
93
  }
91
94
  }
92
95
 
93
- setRealColorConstructor(Color);
96
+ setRealColorConstructor((...args) => new Color(...args));
94
97
 
95
98
  module.exports = { Color };
package/lib/image.js CHANGED
@@ -13,7 +13,11 @@ class Image extends _Image {
13
13
  validateTypeOf(src, 'src', _Image);
14
14
  validateTypeOf(destX, 'destX', 'number');
15
15
  validateTypeOf(destY, 'destY', 'number');
16
- validateTypeOf(sourceRect, 'sourceRectOrApplyAlpha', [ 'boolean', IntRect ], true);
16
+ validateTypeOf(
17
+ sourceRect,
18
+ 'sourceRectOrApplyAlpha',
19
+ [ 'boolean', IntRect ],
20
+ true);
17
21
  validateTypeOf(applyAlpha, 'applyAlpha', 'boolean', true);
18
22
 
19
23
  if (sourceRect === undefined && applyAlpha === undefined) {
@@ -30,7 +34,14 @@ class Image extends _Image {
30
34
  create(width, height, colorOrPixels) {
31
35
  validateTypeOf(width, 'width', 'number');
32
36
  validateTypeOf(height, 'height', 'number');
33
- validateTypeOf(colorOrPixels, 'colorOrPixels', [ Color, Buffer, Array, ArrayBuffer, Uint8Array, 'number' ]);
37
+ validateTypeOf(colorOrPixels, 'colorOrPixels', [
38
+ Color,
39
+ Buffer,
40
+ Array,
41
+ ArrayBuffer,
42
+ Uint8Array,
43
+ 'number',
44
+ ]);
34
45
 
35
46
  if (typeof colorOrPixels === 'number') {
36
47
  colorOrPixels = new Color(colorOrPixels);
@@ -122,13 +133,15 @@ class Image extends _Image {
122
133
  });
123
134
 
124
135
  if (err) {
125
- process.nextTick(() => { reject(err); });
136
+ process.nextTick(() => {
137
+ reject(err);
138
+ });
126
139
  }
127
140
 
128
141
  return promise;
129
142
  }
130
143
  }
131
144
 
132
- Image.setRealConstructor(Image);
145
+ Image.setRealConstructor((...args) => new Image(...args));
133
146
 
134
147
  module.exports = { Image };
package/lib/keyboard.js CHANGED
@@ -6,7 +6,9 @@ const {
6
6
  Keys,
7
7
  } = require('../build/Release/binding.node');
8
8
 
9
- exports.setVirtualKeyboardVisible = function setVirtualKeyboardVisible(visible) {
9
+ exports.setVirtualKeyboardVisible = function setVirtualKeyboardVisible(
10
+ visible
11
+ ) {
10
12
  _setVirtualKeyboardVisible(!!visible);
11
13
  };
12
14
 
package/lib/rect.js CHANGED
@@ -2,7 +2,10 @@
2
2
 
3
3
  const util = require('util');
4
4
 
5
- const { FloatRect: _FloatRect, IntRect: _IntRect } = require('../build/Release/binding.node');
5
+ const {
6
+ FloatRect: _FloatRect,
7
+ IntRect: _IntRect,
8
+ } = require('../build/Release/binding.node');
6
9
  const { validateTypeOf } = require('./common');
7
10
  const { Vector2F, Vector2I } = require('./vector2');
8
11
 
@@ -15,7 +18,12 @@ function createClass(name, BaseClz, Vector) {
15
18
  }
16
19
 
17
20
  toJSON() {
18
- return { left: this.left, top: this.top, width: this.width, height: this.height };
21
+ return {
22
+ left: this.left,
23
+ top: this.top,
24
+ width: this.width,
25
+ height: this.height,
26
+ };
19
27
  }
20
28
 
21
29
  constructor(leftOrPosition, topOrSize, width, height) {
@@ -42,25 +50,37 @@ function createClass(name, BaseClz, Vector) {
42
50
  }
43
51
  }
44
52
 
45
- get top() { return super.top; }
53
+ get top() {
54
+ return super.top;
55
+ }
56
+
46
57
  set top(val) {
47
58
  validateTypeOf(val, 'top', 'number');
48
59
  super.top = val;
49
60
  }
50
61
 
51
- get left() { return super.left; }
62
+ get left() {
63
+ return super.left;
64
+ }
65
+
52
66
  set left(val) {
53
67
  validateTypeOf(val, 'left', 'number');
54
68
  super.left = val;
55
69
  }
56
70
 
57
- get width() { return super.width; }
71
+ get width() {
72
+ return super.width;
73
+ }
74
+
58
75
  set width(val) {
59
76
  validateTypeOf(val, 'width', 'number');
60
77
  super.width = val;
61
78
  }
62
79
 
63
- get height() { return super.height; }
80
+ get height() {
81
+ return super.height;
82
+ }
83
+
64
84
  set height(val) {
65
85
  validateTypeOf(val, 'height', 'number');
66
86
  super.height = val;
@@ -91,9 +111,9 @@ function createClass(name, BaseClz, Vector) {
91
111
  }
92
112
 
93
113
  const IntRect = createClass('IntRect', _IntRect, Vector2I);
94
- _IntRect.setRealConstructor(IntRect);
114
+ _IntRect.setRealConstructor((...args) => new IntRect(...args));
95
115
 
96
116
  const FloatRect = createClass('FloatRect', _FloatRect, Vector2F);
97
- _FloatRect.setRealConstructor(FloatRect);
117
+ _FloatRect.setRealConstructor((...args) => new FloatRect(...args));
98
118
 
99
119
  module.exports = { FloatRect, IntRect };
@@ -2,7 +2,9 @@
2
2
 
3
3
  const { Color } = require('./color');
4
4
  const { Drawable } = require('./drawable/drawable');
5
- const { RenderWindow: _RenderWindow } = require('../build/Release/binding.node');
5
+ const {
6
+ RenderWindow: _RenderWindow,
7
+ } = require('../build/Release/binding.node');
6
8
  const { validateTypeOf } = require('./common');
7
9
  const { VideoMode } = require('./video_mode');
8
10
 
package/lib/texture.d.ts CHANGED
@@ -14,6 +14,7 @@ export class Texture {
14
14
  update(texture: Texture, x: number, y: number): void;
15
15
  update(image: Image): void;
16
16
  update(image: Image, x: number, y: number): void;
17
+ update(buffer: Buffer, width?: number, height?: number, x?: number, y?: number): void;
17
18
 
18
19
  getSize(): Vector2F;
19
20
  setSmooth(smooth?: boolean): void;
package/lib/texture.js CHANGED
@@ -62,6 +62,16 @@ class Texture extends _Texture {
62
62
  this.updateByImage(arguments[0], arguments[1], arguments[2]);
63
63
  return;
64
64
  }
65
+
66
+ if (arguments.length >= 1 && Buffer.isBuffer(arguments[0])) {
67
+ this.updateByPixels(
68
+ arguments[0],
69
+ arguments[1],
70
+ arguments[2],
71
+ arguments[3],
72
+ arguments[4]);
73
+ return;
74
+ }
65
75
  }
66
76
 
67
77
  updateByImage(image, x, y) {
@@ -100,6 +110,15 @@ class Texture extends _Texture {
100
110
  super.updateByTexture(texture, x, y);
101
111
  }
102
112
 
113
+ updateByPixels(buffer, width, height, x, y) {
114
+ validateTypeOf(buffer, 'buffer', Buffer);
115
+ validateTypeOf(width, 'width', 'number', true);
116
+ validateTypeOf(height, 'height', 'number', true);
117
+ validateTypeOf(x, 'x', 'number', true);
118
+ validateTypeOf(y, 'y', 'number', true);
119
+ super.updateByPixels(buffer, width, height, x, y);
120
+ }
121
+
103
122
  setSmooth(smooth = true) {
104
123
  super.setSmooth(!!smooth);
105
124
  }
package/lib/vector2.js CHANGED
@@ -43,14 +43,20 @@ function createClass(name, BaseClz, checkRange, formatBaseValue = v => v) {
43
43
  }
44
44
  }
45
45
 
46
- get x() { return super.x; }
46
+ get x() {
47
+ return super.x;
48
+ }
49
+
47
50
  set x(val) {
48
51
  validateTypeOf(val, 'x', 'number');
49
52
  checkRange(val);
50
53
  super.x = formatBaseValue(val);
51
54
  }
52
55
 
53
- get y() { return super.y; }
56
+ get y() {
57
+ return super.y;
58
+ }
59
+
54
60
  set y(val) {
55
61
  validateTypeOf(val, 'y', 'number');
56
62
  checkRange(val);
@@ -111,17 +117,25 @@ function createClass(name, BaseClz, checkRange, formatBaseValue = v => v) {
111
117
  };
112
118
  }
113
119
 
114
- const Vector2I = createClass('Vector2I', _Vector2I, () => true, v => parseInt(v));
115
- _Vector2I.setRealConstructor(Vector2I);
116
-
117
- const Vector2U = createClass('Vector2U', _Vector2U, v => {
118
- if (v < 0) {
119
- throw new Error('Value should greater than or equal to 0.');
120
- }
121
- }, v => parseInt(v));
122
- _Vector2U.setRealConstructor(Vector2U);
120
+ const Vector2I = createClass(
121
+ 'Vector2I',
122
+ _Vector2I,
123
+ () => true,
124
+ v => parseInt(v));
125
+ _Vector2I.setRealConstructor((...args) => new Vector2I(...args));
126
+
127
+ const Vector2U = createClass(
128
+ 'Vector2U',
129
+ _Vector2U,
130
+ v => {
131
+ if (v < 0) {
132
+ throw new Error('Value should greater than or equal to 0.');
133
+ }
134
+ },
135
+ v => parseInt(v));
136
+ _Vector2U.setRealConstructor((...args) => new Vector2U(...args));
123
137
 
124
138
  const Vector2F = createClass('Vector2F', _Vector2F, () => true);
125
- _Vector2F.setRealConstructor(Vector2F);
139
+ _Vector2F.setRealConstructor((...args) => new Vector2F(...args));
126
140
 
127
141
  module.exports = { Vector2I, Vector2U, Vector2F };
package/lib/vertex.js CHANGED
@@ -67,7 +67,9 @@ class Vertex extends _Vertex {
67
67
 
68
68
  [UNINJECT](object, properties) {
69
69
  for (const property of properties) {
70
- const origDesc = Object.getOwnPropertyDescriptor(object, `orig$$${property}`);
70
+ const origDesc = Object.getOwnPropertyDescriptor(
71
+ object,
72
+ `orig$$${property}`);
71
73
  origDesc.enumerable = true;
72
74
  Object.defineProperty(object, property, origDesc);
73
75
  delete object[`orig$$${property}`];
@@ -170,6 +172,6 @@ class Vertex extends _Vertex {
170
172
  }
171
173
  }
172
174
 
173
- _Vertex.setRealConstructor(Vertex);
175
+ _Vertex.setRealConstructor((...args) => new Vertex(...args));
174
176
 
175
177
  module.exports = { Vertex };
package/lib/video_mode.js CHANGED
@@ -25,7 +25,11 @@ class VideoMode {
25
25
  }
26
26
 
27
27
  toJSON() {
28
- return { width: this.width, height: this.height, bitsPerPixel: this.bitsPerPixel };
28
+ return {
29
+ width: this.width,
30
+ height: this.height,
31
+ bitsPerPixel: this.bitsPerPixel,
32
+ };
29
33
  }
30
34
 
31
35
  constructor(modeWidth, modeHeight, modeBitsPerPixel) {
@@ -42,13 +46,19 @@ class VideoMode {
42
46
  this[RAW_VIDEO_MODE] = new _VideoMode();
43
47
  return;
44
48
  } else if (modeHeight === undefined) {
45
- throw new Error('modeHeight cannot be undefined while modeWidth is not undefined.');
49
+ throw new Error(
50
+ 'modeHeight cannot be undefined while modeWidth is not undefined.');
46
51
  }
47
52
 
48
53
  if (modeBitsPerPixel === undefined) {
49
- this[RAW_VIDEO_MODE] = new _VideoMode(parseInt(modeWidth), parseInt(modeHeight));
54
+ this[RAW_VIDEO_MODE] = new _VideoMode(
55
+ parseInt(modeWidth),
56
+ parseInt(modeHeight));
50
57
  } else {
51
- this[RAW_VIDEO_MODE] = new _VideoMode(parseInt(modeWidth), parseInt(modeHeight), parseInt(modeBitsPerPixel));
58
+ this[RAW_VIDEO_MODE] = new _VideoMode(
59
+ parseInt(modeWidth),
60
+ parseInt(modeHeight),
61
+ parseInt(modeBitsPerPixel));
52
62
  }
53
63
  }
54
64
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sfml.js",
3
- "version": "0.0.1-preview.37",
3
+ "version": "0.0.1-preview.40",
4
4
  "description": "SFML's Node.js binding.",
5
5
  "main": "lib/sfml.js",
6
6
  "scripts": {
@@ -9,7 +9,7 @@
9
9
  "clang-format": "./tools/clang_format.js --style=file -i ./src/*.cc ./src/*.h ./src/drawable/*.cc ./src/drawable/*.h ./src/sound/*.cc ./src/sound/*.h ./src/workers/*.h",
10
10
  "preinstall": "node tools/symlinks.js",
11
11
  "cpplint": "./third_party/cpplint/cpplint.py src/**/*",
12
- "jslint": "eslint .",
12
+ "jslint": "./node_modules/.bin/eslint ./**/*.js",
13
13
  "install": "node-gyp rebuild"
14
14
  },
15
15
  "repository": {
@@ -29,9 +29,12 @@
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/node": "^16.11.6",
32
- "eslint": "^6.0.0",
32
+ "@typescript-eslint/eslint-plugin": "^5.4.0",
33
+ "eslint": "^7.0.0",
33
34
  "eslint-config-egg": "^9.0.0",
34
35
  "eslint-plugin-import": "^2.25.2",
36
+ "eslint-plugin-jsdoc": "^37.0.3",
37
+ "eslint-plugin-node": "^11.1.0",
35
38
  "typescript": "~4.0.0"
36
39
  },
37
40
  "files": [
@@ -51,6 +54,8 @@
51
54
  "third_party/sfml/platform/macOS/lib/libsfml-network.2.5.1.dylib",
52
55
  "third_party/sfml/platform/macOS/lib/libsfml-graphics.2.5.1.dylib",
53
56
  "third_party/sfml/platform/macOS/Frameworks/**/*",
57
+ "third_party/sfml/platform/win64/lib/*.lib",
58
+ "third_party/sfml/platform/win64/bin/*.dll",
54
59
  "tools/*",
55
60
  "tsconfig.json"
56
61
  ]
package/src/color.cc CHANGED
@@ -3,7 +3,6 @@
3
3
  namespace node_sfml {
4
4
  namespace color {
5
5
 
6
- using v8::Context;
7
6
  using v8::EscapableHandleScope;
8
7
  using v8::Function;
9
8
  using v8::FunctionTemplate;
@@ -28,18 +27,17 @@ MaybeLocal<Object> Color::NewRealColorInstance(Isolate* isolate,
28
27
  }
29
28
 
30
29
  Local<Function> func = real_constructor.Get(isolate);
31
- Local<Context> context = isolate->GetCurrentContext();
32
30
  Local<Value> argv[] = {Nan::New(val)};
33
31
 
34
32
  Nan::TryCatch try_catch;
35
- ret = func->NewInstance(context, 1, argv).ToLocalChecked();
33
+ MaybeLocal<Value> maybe = Nan::Call(func, func, 1, argv);
36
34
  if (try_catch.HasCaught()) {
37
35
  try_catch.ReThrow();
38
36
  Local<Object> empty;
39
37
  return scope.Escape(empty);
40
38
  }
41
39
 
42
- return scope.Escape(ret);
40
+ return scope.Escape(maybe.ToLocalChecked().As<Object>());
43
41
  }
44
42
 
45
43
  NAN_METHOD(SetRealColorConstructor) {
@@ -151,7 +149,7 @@ NAN_METHOD(Color::ToInteger) {
151
149
 
152
150
  #define V(name, lowercase) \
153
151
  NAN_METHOD(Color::name##Getter) { \
154
- Color* color = Nan::ObjectWrap::Unwrap<Color>(info.Holder()); \
152
+ Color* color = Nan::ObjectWrap::Unwrap<Color>(info.This()); \
155
153
  info.GetReturnValue().Set(color->_color->lowercase); \
156
154
  } \
157
155
  \
@@ -167,7 +165,7 @@ NAN_METHOD(Color::ToInteger) {
167
165
  return; \
168
166
  } \
169
167
  \
170
- Color* color = Nan::ObjectWrap::Unwrap<Color>(info.Holder()); \
168
+ Color* color = Nan::ObjectWrap::Unwrap<Color>(info.This()); \
171
169
  color->_color->lowercase = val; \
172
170
  }
173
171
 
@@ -59,7 +59,7 @@ inline static NAN_METHOD(GetTextureRect) {
59
59
  };
60
60
 
61
61
  Nan::TryCatch try_catch;
62
- v8::MaybeLocal<v8::Object> maybe_rect =
62
+ v8::MaybeLocal<v8::Value> maybe_rect =
63
63
  rect::IntRect::NewRealInstance(info.GetIsolate(), argc, argv);
64
64
  if (maybe_rect.IsEmpty()) {
65
65
  try_catch.ReThrow();
@@ -88,14 +88,15 @@ inline void SetPrototype(v8::Local<v8::FunctionTemplate>* _tpl) {
88
88
  sf::FloatRect rect = drawable->raw<T>().get##type##Bounds(); \
89
89
  \
90
90
  Nan::TryCatch try_catch; \
91
- v8::MaybeLocal<v8::Object> maybe_rect = \
91
+ v8::MaybeLocal<v8::Value> maybe_rect = \
92
92
  rect::FloatRect::NewRealInstance(info.GetIsolate()); \
93
93
  if (try_catch.HasCaught()) { \
94
94
  try_catch.ReThrow(); \
95
95
  return; \
96
96
  } \
97
97
  \
98
- v8::Local<v8::Object> node_rect = maybe_rect.ToLocalChecked(); \
98
+ v8::Local<v8::Object> node_rect = \
99
+ maybe_rect.ToLocalChecked().As<v8::Object>(); \
99
100
  sf::FloatRect& ret = \
100
101
  Nan::ObjectWrap::Unwrap<rect::FloatRect>(node_rect)->rect(); \
101
102
  ret.top = rect.top; \
@@ -1,6 +1,6 @@
1
1
  #include <SFML/Graphics/RectangleShape.hpp>
2
2
 
3
- #include "../vector2.h"
3
+ #include "../vector2-inl.h"
4
4
  #include "drawable-inl.h"
5
5
  #include "rectangle_shape.h"
6
6
 
@@ -11,6 +11,7 @@ using v8::FunctionTemplate;
11
11
  using v8::Local;
12
12
  using v8::MaybeLocal;
13
13
  using v8::Object;
14
+ using v8::Value;
14
15
 
15
16
  const char rectangle_shape_name[] = "RectangleShape";
16
17
 
@@ -42,7 +43,7 @@ NAN_METHOD(RectangleShape::GetSize) {
42
43
  sf::Vector2f vec = shape->raw<sf::RectangleShape>().getSize();
43
44
 
44
45
  Nan::TryCatch try_catch;
45
- MaybeLocal<Object> maybe_vec =
46
+ MaybeLocal<Value> maybe_vec =
46
47
  vector2::Vector2F::NewRealInstance(info.GetIsolate(), vec);
47
48
  if (maybe_vec.IsEmpty()) {
48
49
  try_catch.ReThrow();
@@ -9,7 +9,9 @@ namespace node_sfml {
9
9
  namespace drawable {
10
10
 
11
11
  using v8::Local;
12
+ using v8::MaybeLocal;
12
13
  using v8::Object;
14
+ using v8::Value;
13
15
 
14
16
  void Shape::SetPrototype(v8::Local<v8::FunctionTemplate>* _tpl) {
15
17
  v8::Local<v8::FunctionTemplate>& tpl = *_tpl;
@@ -41,7 +43,7 @@ NAN_METHOD(Shape::GetPoint) {
41
43
  sf::Vector2f point = raw.getPoint(Nan::To<sf::Uint32>(info[0]).FromJust());
42
44
 
43
45
  Nan::TryCatch try_catch;
44
- v8::MaybeLocal<v8::Object> maybe_vec =
46
+ MaybeLocal<Value> maybe_vec =
45
47
  vector2::Vector2F::NewRealInstance(info.GetIsolate(), point);
46
48
  if (maybe_vec.IsEmpty()) {
47
49
  try_catch.ReThrow();
@@ -127,14 +127,14 @@ NAN_METHOD(VertexArray::GetBounds) {
127
127
  sf::FloatRect rect = va->raw<sf::VertexArray>().getBounds();
128
128
 
129
129
  Nan::TryCatch try_catch;
130
- v8::MaybeLocal<v8::Object> maybe_rect =
130
+ v8::MaybeLocal<v8::Value> maybe_rect =
131
131
  rect::FloatRect::NewRealInstance(info.GetIsolate());
132
132
  if (try_catch.HasCaught()) {
133
133
  try_catch.ReThrow();
134
134
  return;
135
135
  }
136
136
 
137
- v8::Local<v8::Object> node_rect = maybe_rect.ToLocalChecked();
137
+ v8::Local<v8::Object> node_rect = maybe_rect.ToLocalChecked().As<Object>();
138
138
  sf::FloatRect& ret =
139
139
  Nan::ObjectWrap::Unwrap<rect::FloatRect>(node_rect)->rect();
140
140
  ret.top = rect.top;
@@ -167,7 +167,7 @@ NAN_METHOD(VertexArray::DuplicateVertex) {
167
167
  const sf::Vertex& vertex = raw[idx];
168
168
 
169
169
  Nan::TryCatch try_catch;
170
- MaybeLocal<Object> maybe_ret =
170
+ MaybeLocal<Value> maybe_ret =
171
171
  vertex::Vertex::NewRealInstance(info.GetIsolate(), vertex);
172
172
  if (maybe_ret.IsEmpty()) {
173
173
  try_catch.ReThrow();
package/src/font.cc CHANGED
@@ -122,13 +122,14 @@ NAN_METHOD(Font::GetGlyph) {
122
122
  Nan::New<Number>(static_cast<double>(glyph.advance)));
123
123
 
124
124
  Nan::TryCatch try_catch;
125
- MaybeLocal<Object> maybe_float_rect_object =
125
+ MaybeLocal<Value> maybe_float_rect_object =
126
126
  rect::FloatRect::NewRealInstance(info.GetIsolate());
127
127
  if (maybe_float_rect_object.IsEmpty()) {
128
128
  try_catch.ReThrow();
129
129
  return;
130
130
  }
131
- Local<Object> float_rect_object = maybe_float_rect_object.ToLocalChecked();
131
+ Local<Object> float_rect_object =
132
+ maybe_float_rect_object.ToLocalChecked().As<Object>();
132
133
  rect::FloatRect* float_rect =
133
134
  Nan::ObjectWrap::Unwrap<rect::FloatRect>(float_rect_object);
134
135
  sf::FloatRect& float_rect_inner = float_rect->rect();
@@ -138,13 +139,14 @@ NAN_METHOD(Font::GetGlyph) {
138
139
  float_rect_inner.height = glyph.bounds.height;
139
140
  Nan::Set(ret, Nan::New<String>("bounds").ToLocalChecked(), float_rect_object);
140
141
 
141
- MaybeLocal<Object> maybe_int_rect_object =
142
+ MaybeLocal<Value> maybe_int_rect_object =
142
143
  rect::IntRect::NewRealInstance(info.GetIsolate());
143
144
  if (maybe_int_rect_object.IsEmpty()) {
144
145
  try_catch.ReThrow();
145
146
  return;
146
147
  }
147
- Local<Object> int_rect_object = maybe_int_rect_object.ToLocalChecked();
148
+ Local<Object> int_rect_object =
149
+ maybe_int_rect_object.ToLocalChecked().As<Object>();
148
150
  rect::IntRect* int_rect =
149
151
  Nan::ObjectWrap::Unwrap<rect::IntRect>(int_rect_object);
150
152
  sf::IntRect& int_rect_inner = int_rect->rect();
package/src/image.cc CHANGED
@@ -26,10 +26,9 @@ NAN_METHOD(SetRealConstructor) {
26
26
  real_constructor.Reset(info[0].As<v8::Function>());
27
27
  }
28
28
 
29
- MaybeLocal<Object> Image::NewRealInstance(Isolate* isolate) {
30
- v8::Local<v8::Function> cons = real_constructor.Get(isolate);
31
- v8::MaybeLocal<v8::Object> maybe_ret =
32
- cons->NewInstance(isolate->GetCurrentContext());
29
+ MaybeLocal<Value> Image::NewRealInstance(Isolate* isolate) {
30
+ Local<Function> cons = real_constructor.Get(isolate);
31
+ MaybeLocal<Value> maybe_ret = Nan::Call(cons, cons, 0, nullptr);
33
32
  return maybe_ret;
34
33
  }
35
34
 
@@ -160,7 +159,7 @@ NAN_METHOD(Image::GetSize) {
160
159
  sf::Vector2u size = image->_image.getSize();
161
160
 
162
161
  Nan::TryCatch try_catch;
163
- MaybeLocal<Object> size_obj =
162
+ MaybeLocal<Value> size_obj =
164
163
  vector2::Vector2<sf::Uint32, sf::Uint32, v8::Uint32>::NewRealInstance(
165
164
  info.GetIsolate(), size);
166
165
  if (size_obj.IsEmpty()) {
package/src/image.h CHANGED
@@ -15,7 +15,7 @@ namespace image {
15
15
  class Image : public Nan::ObjectWrap, public BaseClassWithLoading {
16
16
  public:
17
17
  static NAN_MODULE_INIT(Init);
18
- static v8::MaybeLocal<v8::Object> NewRealInstance(v8::Isolate* isolate);
18
+ static v8::MaybeLocal<v8::Value> NewRealInstance(v8::Isolate* isolate);
19
19
 
20
20
  public:
21
21
  static NAN_METHOD(New);
package/src/mouse.cc CHANGED
@@ -15,6 +15,7 @@ using v8::Local;
15
15
  using v8::MaybeLocal;
16
16
  using v8::Object;
17
17
  using v8::String;
18
+ using v8::Value;
18
19
 
19
20
  NAN_MODULE_INIT(Init) {
20
21
  gen::InitMouseButton();
@@ -65,7 +66,7 @@ NAN_METHOD(GetPosition) {
65
66
  }
66
67
 
67
68
  Nan::TryCatch try_catch;
68
- MaybeLocal<Object> ret =
69
+ MaybeLocal<Value> ret =
69
70
  vector2::Vector2I::NewRealInstance(info.GetIsolate(), pos);
70
71
  if (ret.IsEmpty()) {
71
72
  try_catch.ReThrow();