sfml.js 0.0.1-preview.39 → 0.0.1-preview.42
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.
- package/README.md +43 -6
- package/binding.gyp +53 -0
- package/lib/joystick.d.ts +21 -0
- package/lib/joystick.js +72 -0
- package/lib/keyboard.d.ts +1 -0
- package/lib/mouse.d.ts +1 -1
- package/lib/poll_event.d.ts +73 -9
- package/lib/rect.d.ts +1 -1
- package/lib/sensor.d.ts +12 -0
- package/lib/sensor.js +34 -0
- package/lib/sfml.d.ts +4 -0
- package/lib/sfml.js +4 -0
- package/lib/touch.d.ts +7 -0
- package/lib/touch.js +34 -0
- package/lib/vector3.d.ts +47 -0
- package/lib/vector3.js +154 -0
- package/package.json +3 -2
- package/src/gen/joystick_axis.cc +30 -0
- package/src/gen/sensor_type.cc +26 -0
- package/src/joystick.cc +132 -0
- package/src/joystick.h +32 -0
- package/src/poll_event.cc +74 -1
- package/src/resizable_buffer.h +1 -0
- package/src/sensor.cc +82 -0
- package/src/sensor.h +28 -0
- package/src/sfml.cc +12 -0
- package/src/touch.cc +54 -0
- package/src/touch.h +23 -0
- package/src/utils-inl.h +2 -2
- package/src/vector3-inl.h +200 -0
- package/src/vector3.cc +36 -0
- package/src/vector3.h +134 -0
- package/tools/joystick_axis.js +62 -0
- package/tools/keycode.js +5 -3
- package/tools/mouse_button.js +9 -5
- package/tools/sensor_type.js +62 -0
- package/third_party/sfml/platform/macOS/Frameworks/FLAC.framework/Resources/Info.plist +0 -22
- package/third_party/sfml/platform/macOS/Frameworks/FLAC.framework/Versions/Current/FLAC +0 -0
- package/third_party/sfml/platform/macOS/Frameworks/FLAC.framework/Versions/Current/Resources/Info.plist +0 -22
- package/third_party/sfml/platform/macOS/Frameworks/OpenAL.framework/Resources/Info.plist +0 -22
- package/third_party/sfml/platform/macOS/Frameworks/OpenAL.framework/Versions/Current/OpenAL +0 -0
- package/third_party/sfml/platform/macOS/Frameworks/OpenAL.framework/Versions/Current/Resources/Info.plist +0 -22
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/AlResource.hpp +0 -70
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/Export.hpp +0 -48
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/InputSoundFile.hpp +0 -263
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/Listener.hpp +0 -234
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/Music.hpp +0 -337
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/OutputSoundFile.hpp +0 -133
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/Sound.hpp +0 -264
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/SoundBuffer.hpp +0 -352
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/SoundBufferRecorder.hpp +0 -144
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/SoundFileFactory.hpp +0 -197
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/SoundFileFactory.inl +0 -100
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/SoundFileReader.hpp +0 -165
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/SoundFileWriter.hpp +0 -125
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/SoundRecorder.hpp +0 -408
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/SoundSource.hpp +0 -332
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio/SoundStream.hpp +0 -405
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Audio.hpp +0 -56
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Config.hpp +0 -236
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/GpuPreference.hpp +0 -74
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/BlendMode.hpp +0 -215
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/CircleShape.hpp +0 -154
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Color.hpp +0 -275
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/ConvexShape.hpp +0 -153
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Drawable.hpp +0 -126
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Export.hpp +0 -48
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Font.hpp +0 -439
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Glsl.hpp +0 -227
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Glsl.inl +0 -155
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Glyph.hpp +0 -79
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Image.hpp +0 -324
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/PrimitiveType.hpp +0 -58
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Rect.hpp +0 -254
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Rect.inl +0 -159
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/RectangleShape.hpp +0 -132
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/RenderStates.hpp +0 -174
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/RenderTarget.hpp +0 -510
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/RenderTexture.hpp +0 -314
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/RenderWindow.hpp +0 -284
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Shader.hpp +0 -875
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Shape.hpp +0 -355
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Sprite.hpp +0 -279
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Text.hpp +0 -513
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Texture.hpp +0 -733
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Transform.hpp +0 -479
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Transformable.hpp +0 -429
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/Vertex.hpp +0 -148
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/VertexArray.hpp +0 -223
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/VertexBuffer.hpp +0 -408
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics/View.hpp +0 -343
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Graphics.hpp +0 -68
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Main.hpp +0 -43
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network/Export.hpp +0 -48
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network/Ftp.hpp +0 -616
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network/Http.hpp +0 -482
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network/IpAddress.hpp +0 -328
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network/Packet.hpp +0 -532
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network/Socket.hpp +0 -219
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network/SocketHandle.hpp +0 -57
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network/SocketSelector.hpp +0 -263
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network/TcpListener.hpp +0 -166
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network/TcpSocket.hpp +0 -316
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network/UdpSocket.hpp +0 -291
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Network.hpp +0 -53
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/OpenGL.hpp +0 -78
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Clock.hpp +0 -117
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Err.hpp +0 -80
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Export.hpp +0 -48
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/FileInputStream.hpp +0 -169
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/InputStream.hpp +0 -152
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Lock.hpp +0 -139
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/MemoryInputStream.hpp +0 -148
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Mutex.hpp +0 -148
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/NativeActivity.hpp +0 -62
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/NonCopyable.hpp +0 -129
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Sleep.hpp +0 -52
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/String.hpp +0 -669
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/String.inl +0 -53
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Thread.hpp +0 -282
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Thread.inl +0 -90
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/ThreadLocal.hpp +0 -103
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/ThreadLocalPtr.hpp +0 -158
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/ThreadLocalPtr.inl +0 -77
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Time.hpp +0 -488
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Utf.hpp +0 -763
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Utf.inl +0 -752
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Vector2.hpp +0 -301
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Vector2.inl +0 -161
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Vector3.hpp +0 -302
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System/Vector3.inl +0 -168
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/System.hpp +0 -60
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/Clipboard.hpp +0 -119
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/Context.hpp +0 -195
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/ContextSettings.hpp +0 -149
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/Cursor.hpp +0 -222
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/Event.hpp +0 -284
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/Export.hpp +0 -48
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/GlResource.hpp +0 -109
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/Joystick.hpp +0 -227
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/Keyboard.hpp +0 -232
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/Mouse.hpp +0 -177
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/Sensor.hpp +0 -150
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/Touch.hpp +0 -137
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/VideoMode.hpp +0 -228
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/Window.hpp +0 -622
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/WindowHandle.hpp +0 -101
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window/WindowStyle.hpp +0 -53
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Headers/Window.hpp +0 -58
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Resources/CMake/SFMLConfig.cmake +0 -148
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Resources/CMake/SFMLConfigDependencies.cmake +0 -86
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Resources/CMake/SFMLConfigVersion.cmake +0 -46
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Resources/CMake/SFMLSharedTargets-release.cmake +0 -59
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Resources/CMake/SFMLSharedTargets.cmake +0 -158
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Resources/Info.plist +0 -26
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/AlResource.hpp +0 -70
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/Export.hpp +0 -48
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/InputSoundFile.hpp +0 -263
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/Listener.hpp +0 -234
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/Music.hpp +0 -337
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/OutputSoundFile.hpp +0 -133
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/Sound.hpp +0 -264
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/SoundBuffer.hpp +0 -352
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/SoundBufferRecorder.hpp +0 -144
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/SoundFileFactory.hpp +0 -197
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/SoundFileFactory.inl +0 -100
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/SoundFileReader.hpp +0 -165
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/SoundFileWriter.hpp +0 -125
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/SoundRecorder.hpp +0 -408
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/SoundSource.hpp +0 -332
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio/SoundStream.hpp +0 -405
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Audio.hpp +0 -56
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Config.hpp +0 -236
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/GpuPreference.hpp +0 -74
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/BlendMode.hpp +0 -215
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/CircleShape.hpp +0 -154
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Color.hpp +0 -275
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/ConvexShape.hpp +0 -153
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Drawable.hpp +0 -126
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Export.hpp +0 -48
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Font.hpp +0 -439
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Glsl.hpp +0 -227
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Glsl.inl +0 -155
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Glyph.hpp +0 -79
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Image.hpp +0 -324
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/PrimitiveType.hpp +0 -58
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Rect.hpp +0 -254
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Rect.inl +0 -159
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/RectangleShape.hpp +0 -132
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/RenderStates.hpp +0 -174
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/RenderTarget.hpp +0 -510
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/RenderTexture.hpp +0 -314
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/RenderWindow.hpp +0 -284
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Shader.hpp +0 -875
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Shape.hpp +0 -355
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Sprite.hpp +0 -279
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Text.hpp +0 -513
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Texture.hpp +0 -733
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Transform.hpp +0 -479
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Transformable.hpp +0 -429
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/Vertex.hpp +0 -148
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/VertexArray.hpp +0 -223
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/VertexBuffer.hpp +0 -408
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics/View.hpp +0 -343
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Graphics.hpp +0 -68
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Main.hpp +0 -43
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network/Export.hpp +0 -48
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network/Ftp.hpp +0 -616
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network/Http.hpp +0 -482
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network/IpAddress.hpp +0 -328
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network/Packet.hpp +0 -532
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network/Socket.hpp +0 -219
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network/SocketHandle.hpp +0 -57
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network/SocketSelector.hpp +0 -263
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network/TcpListener.hpp +0 -166
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network/TcpSocket.hpp +0 -316
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network/UdpSocket.hpp +0 -291
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Network.hpp +0 -53
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/OpenGL.hpp +0 -78
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Clock.hpp +0 -117
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Err.hpp +0 -80
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Export.hpp +0 -48
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/FileInputStream.hpp +0 -169
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/InputStream.hpp +0 -152
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Lock.hpp +0 -139
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/MemoryInputStream.hpp +0 -148
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Mutex.hpp +0 -148
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/NativeActivity.hpp +0 -62
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/NonCopyable.hpp +0 -129
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Sleep.hpp +0 -52
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/String.hpp +0 -669
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/String.inl +0 -53
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Thread.hpp +0 -282
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Thread.inl +0 -90
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/ThreadLocal.hpp +0 -103
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/ThreadLocalPtr.hpp +0 -158
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/ThreadLocalPtr.inl +0 -77
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Time.hpp +0 -488
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Utf.hpp +0 -763
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Utf.inl +0 -752
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Vector2.hpp +0 -301
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Vector2.inl +0 -161
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Vector3.hpp +0 -302
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System/Vector3.inl +0 -168
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/System.hpp +0 -60
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/Clipboard.hpp +0 -119
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/Context.hpp +0 -195
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/ContextSettings.hpp +0 -149
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/Cursor.hpp +0 -222
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/Event.hpp +0 -284
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/Export.hpp +0 -48
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/GlResource.hpp +0 -109
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/Joystick.hpp +0 -227
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/Keyboard.hpp +0 -232
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/Mouse.hpp +0 -177
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/Sensor.hpp +0 -150
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/Touch.hpp +0 -137
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/VideoMode.hpp +0 -228
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/Window.hpp +0 -622
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/WindowHandle.hpp +0 -101
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window/WindowStyle.hpp +0 -53
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Headers/Window.hpp +0 -58
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Resources/CMake/SFMLConfig.cmake +0 -148
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Resources/CMake/SFMLConfigDependencies.cmake +0 -86
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Resources/CMake/SFMLConfigVersion.cmake +0 -46
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Resources/CMake/SFMLSharedTargets-release.cmake +0 -59
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Resources/CMake/SFMLSharedTargets.cmake +0 -158
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/Resources/Info.plist +0 -26
- package/third_party/sfml/platform/macOS/Frameworks/SFML.framework/Versions/Current/SFML +0 -0
- package/third_party/sfml/platform/macOS/Frameworks/freetype.framework/Resources/Info.plist +0 -22
- package/third_party/sfml/platform/macOS/Frameworks/freetype.framework/Versions/Current/Resources/Info.plist +0 -22
- package/third_party/sfml/platform/macOS/Frameworks/freetype.framework/Versions/Current/freetype +0 -0
- package/third_party/sfml/platform/macOS/Frameworks/ogg.framework/Resources/Info.plist +0 -22
- package/third_party/sfml/platform/macOS/Frameworks/ogg.framework/Versions/Current/Resources/Info.plist +0 -22
- package/third_party/sfml/platform/macOS/Frameworks/ogg.framework/Versions/Current/ogg +0 -0
- package/third_party/sfml/platform/macOS/Frameworks/sfml-audio.framework/Resources/Info.plist +0 -26
- package/third_party/sfml/platform/macOS/Frameworks/sfml-audio.framework/Versions/Current/Resources/Info.plist +0 -26
- package/third_party/sfml/platform/macOS/Frameworks/sfml-audio.framework/Versions/Current/sfml-audio +0 -0
- package/third_party/sfml/platform/macOS/Frameworks/sfml-graphics.framework/Resources/Info.plist +0 -26
- package/third_party/sfml/platform/macOS/Frameworks/sfml-graphics.framework/Versions/Current/Resources/Info.plist +0 -26
- package/third_party/sfml/platform/macOS/Frameworks/sfml-graphics.framework/Versions/Current/sfml-graphics +0 -0
- package/third_party/sfml/platform/macOS/Frameworks/sfml-network.framework/Resources/Info.plist +0 -26
- package/third_party/sfml/platform/macOS/Frameworks/sfml-network.framework/Versions/Current/Resources/Info.plist +0 -26
- package/third_party/sfml/platform/macOS/Frameworks/sfml-network.framework/Versions/Current/sfml-network +0 -0
- package/third_party/sfml/platform/macOS/Frameworks/sfml-system.framework/Resources/Info.plist +0 -26
- package/third_party/sfml/platform/macOS/Frameworks/sfml-system.framework/Versions/Current/Resources/Info.plist +0 -26
- package/third_party/sfml/platform/macOS/Frameworks/sfml-system.framework/Versions/Current/sfml-system +0 -0
- package/third_party/sfml/platform/macOS/Frameworks/sfml-window.framework/Resources/Info.plist +0 -26
- package/third_party/sfml/platform/macOS/Frameworks/sfml-window.framework/Versions/Current/Resources/Info.plist +0 -26
- package/third_party/sfml/platform/macOS/Frameworks/sfml-window.framework/Versions/Current/sfml-window +0 -0
- package/third_party/sfml/platform/macOS/Frameworks/vorbis.framework/Resources/Info.plist +0 -22
- package/third_party/sfml/platform/macOS/Frameworks/vorbis.framework/Versions/Current/Resources/Info.plist +0 -22
- package/third_party/sfml/platform/macOS/Frameworks/vorbis.framework/Versions/Current/vorbis +0 -0
- package/third_party/sfml/platform/macOS/Frameworks/vorbisenc.framework/Resources/Info.plist +0 -22
- package/third_party/sfml/platform/macOS/Frameworks/vorbisenc.framework/Versions/Current/Resources/Info.plist +0 -22
- package/third_party/sfml/platform/macOS/Frameworks/vorbisenc.framework/Versions/Current/vorbisenc +0 -0
- package/third_party/sfml/platform/macOS/Frameworks/vorbisfile.framework/Resources/Info.plist +0 -22
- package/third_party/sfml/platform/macOS/Frameworks/vorbisfile.framework/Versions/Current/Resources/Info.plist +0 -22
- package/third_party/sfml/platform/macOS/Frameworks/vorbisfile.framework/Versions/Current/vorbisfile +0 -0
package/README.md
CHANGED
|
@@ -1,15 +1,52 @@
|
|
|
1
|
-
#
|
|
1
|
+
# sfml.js
|
|
2
|
+
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
3
|
+
[](#contributors-)
|
|
4
|
+
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
5
|
+
[](https://www.npmjs.org/package/sfml.js)
|
|
6
|
+
[](https://www.npmjs.org/package/sfml.js)
|
|
7
|
+
[](https://www.npmjs.org/package/sfml.js)
|
|
8
|
+
[](https://github.com/XadillaX/node-sfml)
|
|
2
9
|
|
|
3
10
|

|
|
4
11
|
|
|
5
|
-
SFML's Node.js binding.
|
|
6
|
-
|
|
7
|
-
> Under developing.
|
|
12
|
+
A cross-platform SFML's Node.js binding.
|
|
8
13
|
|
|
9
14
|
## Installation
|
|
10
15
|
|
|
11
16
|
```bash
|
|
12
|
-
$
|
|
17
|
+
$ npm install --save sfml.js
|
|
13
18
|
```
|
|
14
19
|
|
|
15
|
-
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
Refer to Typing Definitions: [https://github.com/XadillaX/node-sfml/blob/main/index.d.ts](https://github.com/XadillaX/node-sfml/blob/main/index.d.ts).
|
|
23
|
+
|
|
24
|
+
And SFML's official documentation: [https://www.sfml-dev.org/documentation/2.5.1/](https://www.sfml-dev.org/documentation/2.5.1/).
|
|
25
|
+
|
|
26
|
+
## Examples
|
|
27
|
+
|
|
28
|
+
+ [node-sfml-demos](https://github.com/XadillaX/node-sfml-demos): Several small example games;
|
|
29
|
+
+ [play-nes](https://github.com/XadillaX/play-nes): A cross-platform desktop NES emulator powered by OpenGL in Node.js.
|
|
30
|
+
|
|
31
|
+
> PR is welcomed. You can add your own sfml.js example.
|
|
32
|
+
|
|
33
|
+
## Contributors ✨
|
|
34
|
+
|
|
35
|
+
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
|
|
36
|
+
|
|
37
|
+
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
|
38
|
+
<!-- prettier-ignore-start -->
|
|
39
|
+
<!-- markdownlint-disable -->
|
|
40
|
+
<table>
|
|
41
|
+
<tr>
|
|
42
|
+
<td align="center"><a href="https://xcoder.in/"><img src="https://avatars.githubusercontent.com/u/2842176?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Khaidi Chu</b></sub></a><br /><a href="#maintenance-XadillaX" title="Maintenance">🚧</a> <a href="https://github.com/XadillaX/node-sfml/commits?author=XadillaX" title="Code">💻</a></td>
|
|
43
|
+
<td align="center"><a href="https://pokemonworkshop.com/forum"><img src="https://avatars.githubusercontent.com/u/7335788?v=4?s=100" width="100px;" alt=""/><br /><sub><b>NuriYuri</b></sub></a><br /><a href="https://github.com/XadillaX/node-sfml/commits?author=NuriYuri" title="Code">💻</a></td>
|
|
44
|
+
</tr>
|
|
45
|
+
</table>
|
|
46
|
+
|
|
47
|
+
<!-- markdownlint-restore -->
|
|
48
|
+
<!-- prettier-ignore-end -->
|
|
49
|
+
|
|
50
|
+
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
51
|
+
|
|
52
|
+
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
|
package/binding.gyp
CHANGED
|
@@ -41,6 +41,48 @@
|
|
|
41
41
|
"./tools/keycode.js"
|
|
42
42
|
]
|
|
43
43
|
}]
|
|
44
|
+
}, {
|
|
45
|
+
"target_name": "joystick_axis.cc",
|
|
46
|
+
"type": "none",
|
|
47
|
+
"sources": [
|
|
48
|
+
"./third_party/sfml/include/SFML/Window/Joystick.hpp",
|
|
49
|
+
"./tools/joystick_axis.js"
|
|
50
|
+
],
|
|
51
|
+
"actions": [{
|
|
52
|
+
"action_name": "gen_joystick_axis",
|
|
53
|
+
"inputs": [
|
|
54
|
+
"./third_party/sfml/include/SFML/Window/Joystick.hpp",
|
|
55
|
+
"./tools/joystick_axis.js"
|
|
56
|
+
],
|
|
57
|
+
"outputs": [
|
|
58
|
+
"./src/gen/joystick_axis.cc"
|
|
59
|
+
],
|
|
60
|
+
"action": [
|
|
61
|
+
"node",
|
|
62
|
+
"./tools/joystick_axis.js"
|
|
63
|
+
]
|
|
64
|
+
}]
|
|
65
|
+
}, {
|
|
66
|
+
"target_name": "sensor_type.cc",
|
|
67
|
+
"type": "none",
|
|
68
|
+
"sources": [
|
|
69
|
+
"./third_party/sfml/include/SFML/Window/Sensor.hpp",
|
|
70
|
+
"./tools/sensor_type.js"
|
|
71
|
+
],
|
|
72
|
+
"actions": [{
|
|
73
|
+
"action_name": "gen_sensor_type",
|
|
74
|
+
"inputs": [
|
|
75
|
+
"./third_party/sfml/include/SFML/Window/Sensor.hpp",
|
|
76
|
+
"./tools/sensor_type.js"
|
|
77
|
+
],
|
|
78
|
+
"outputs": [
|
|
79
|
+
"./src/gen/sensor_type.cc"
|
|
80
|
+
],
|
|
81
|
+
"action": [
|
|
82
|
+
"node",
|
|
83
|
+
"./tools/sensor_type.js"
|
|
84
|
+
]
|
|
85
|
+
}]
|
|
44
86
|
}, {
|
|
45
87
|
"target_name": "binding",
|
|
46
88
|
"include_dirs": [
|
|
@@ -55,6 +97,9 @@
|
|
|
55
97
|
"../third_party/sfml/platform/linux/lib/libsfml-window.so",
|
|
56
98
|
"../third_party/sfml/platform/linux/lib/libsfml-network.so",
|
|
57
99
|
"../third_party/sfml/platform/linux/lib/libsfml-graphics.so"
|
|
100
|
+
],
|
|
101
|
+
"ldflags": [
|
|
102
|
+
"-Wl,-rpath='$$ORIGIN/../../third_party/sfml/platform/linux/lib'"
|
|
58
103
|
]
|
|
59
104
|
}],
|
|
60
105
|
["OS==\"win\"", {
|
|
@@ -112,14 +157,18 @@
|
|
|
112
157
|
"./src/color.cc",
|
|
113
158
|
"./src/font.cc",
|
|
114
159
|
"./src/image.cc",
|
|
160
|
+
"./src/joystick.cc",
|
|
115
161
|
"./src/keyboard.cc",
|
|
116
162
|
"./src/mouse.cc",
|
|
117
163
|
"./src/poll_event.cc",
|
|
118
164
|
"./src/rect.cc",
|
|
119
165
|
"./src/render_window.cc",
|
|
166
|
+
"./src/sensor.cc",
|
|
167
|
+
"./src/touch.cc",
|
|
120
168
|
"./src/texture.cc",
|
|
121
169
|
"./src/time.cc",
|
|
122
170
|
"./src/vector2.cc",
|
|
171
|
+
"./src/vector3.cc",
|
|
123
172
|
"./src/vertex.cc",
|
|
124
173
|
"./src/video_mode.cc",
|
|
125
174
|
|
|
@@ -132,8 +181,10 @@
|
|
|
132
181
|
"./src/drawable/text.cc",
|
|
133
182
|
"./src/drawable/vertex_array.cc",
|
|
134
183
|
|
|
184
|
+
"./src/gen/joystick_axis.cc",
|
|
135
185
|
"./src/gen/keycode.cc",
|
|
136
186
|
"./src/gen/mouse_button.cc",
|
|
187
|
+
"./src/gen/sensor_type.cc",
|
|
137
188
|
|
|
138
189
|
"./src/sound/music.cc",
|
|
139
190
|
"./src/sound/sound.cc",
|
|
@@ -142,6 +193,8 @@
|
|
|
142
193
|
],
|
|
143
194
|
"dependencies": [
|
|
144
195
|
"keycode.cc",
|
|
196
|
+
"joystick_axis.cc",
|
|
197
|
+
"sensor_type.cc",
|
|
145
198
|
"mouse_button.cc"
|
|
146
199
|
]
|
|
147
200
|
}]
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export enum Axis {
|
|
2
|
+
X = 0, Y = 1, Z = 2, R = 3,
|
|
3
|
+
U = 4, V = 5, PovX = 6, PovY = 7
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export type AxisStr = keyof typeof Axis;
|
|
7
|
+
type UnsignedInteger = number;
|
|
8
|
+
|
|
9
|
+
type Identification = {
|
|
10
|
+
name: string;
|
|
11
|
+
vendorId: number;
|
|
12
|
+
productId: number;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export function isConnected(joystickId: UnsignedInteger): boolean;
|
|
16
|
+
export function getButtonCount(joystickId: UnsignedInteger): number;
|
|
17
|
+
export function hasAxis(joystickId: UnsignedInteger, axis: Axis): boolean;
|
|
18
|
+
export function isButtonPressed(joystickId: UnsignedInteger, button: UnsignedInteger): boolean;
|
|
19
|
+
export function getAxisPosition(joystickId: UnsignedInteger, axis: Axis): number;
|
|
20
|
+
export function getIdentification(joystickId: UnsignedInteger): Identification;
|
|
21
|
+
export function update(): void;
|
package/lib/joystick.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const {
|
|
4
|
+
joystickIsConnected: _isConnected,
|
|
5
|
+
joystickGetButtonCount: _getButtonCount,
|
|
6
|
+
joystickHasAxis: _hasAxis,
|
|
7
|
+
joystickIsJoystickButtonPressed: _isButtonPressed,
|
|
8
|
+
joystickGetAxisPosition: _getAxisPosition,
|
|
9
|
+
joystickGetIdentification: _getIdentification,
|
|
10
|
+
joystickUpdate: update,
|
|
11
|
+
joystickAxis: Axis,
|
|
12
|
+
} = require('../build/Release/binding.node');
|
|
13
|
+
|
|
14
|
+
const AxisValues = Object.values(Axis);
|
|
15
|
+
|
|
16
|
+
const validateJoystickId = joystickId => {
|
|
17
|
+
if (!Number.isInteger(joystickId) || Math.sign(joystickId) < 0) {
|
|
18
|
+
throw new TypeError(
|
|
19
|
+
`Unexpected value ${joystickId} for joystickId, expected usigned integer.`
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const validateButton = button => {
|
|
25
|
+
if (!Number.isInteger(button) || Math.sign(button) < 0) {
|
|
26
|
+
throw new TypeError(
|
|
27
|
+
`Unexpected value ${button} for button, expected usigned integer.`
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const validateAxis = axis => {
|
|
33
|
+
if (!AxisValues.includes(axis)) {
|
|
34
|
+
throw new TypeError('Invalid Axis value.');
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
module.exports.isConnected = joystickId => {
|
|
39
|
+
validateJoystickId(joystickId);
|
|
40
|
+
return _isConnected(joystickId);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
module.exports.getButtonCount = joystickId => {
|
|
44
|
+
validateJoystickId(joystickId);
|
|
45
|
+
return _getButtonCount(joystickId);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
module.exports.hasAxis = (joystickId, axis) => {
|
|
49
|
+
validateJoystickId(joystickId);
|
|
50
|
+
validateAxis(axis);
|
|
51
|
+
return _hasAxis(joystickId, axis);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
module.exports.isButtonPressed = (joystickId, button) => {
|
|
55
|
+
validateJoystickId(joystickId);
|
|
56
|
+
validateButton(button);
|
|
57
|
+
return _isButtonPressed(joystickId, button);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
module.exports.getAxisPosition = (joystickId, axis) => {
|
|
61
|
+
validateJoystickId(joystickId);
|
|
62
|
+
validateAxis(axis);
|
|
63
|
+
return _getAxisPosition(joystickId, axis);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
module.exports.getIdentification = joystickId => {
|
|
67
|
+
validateJoystickId(joystickId);
|
|
68
|
+
return _getIdentification(joystickId);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
module.exports.update = update;
|
|
72
|
+
module.exports.Axis = Axis;
|
package/lib/keyboard.d.ts
CHANGED
package/lib/mouse.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PointType, Vector2I } from './vector2';
|
|
2
|
-
import
|
|
2
|
+
import { RenderWindow } from './render_window';
|
|
3
3
|
|
|
4
4
|
export function isButtonPressed(button: number | string): boolean;
|
|
5
5
|
export function getPosition(window?: RenderWindow): Vector2I;
|
package/lib/poll_event.d.ts
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
import { Sensor } from './sensor';
|
|
2
|
+
import { Joystick } from './joystick';
|
|
3
|
+
import { Keys, KeysStr } from './keyboard';
|
|
4
|
+
|
|
1
5
|
interface OtherEvent {
|
|
2
|
-
type:
|
|
3
|
-
|
|
4
|
-
|
|
6
|
+
type:
|
|
7
|
+
| 'Closed'
|
|
8
|
+
| 'LostFocus'
|
|
9
|
+
| 'GainedFocus'
|
|
10
|
+
| 'MouseLeft'
|
|
11
|
+
| 'MouseEntered';
|
|
5
12
|
}
|
|
6
13
|
|
|
7
14
|
interface SizeEvent {
|
|
@@ -15,8 +22,8 @@ interface SizeEvent {
|
|
|
15
22
|
interface KeyEvent {
|
|
16
23
|
type: 'KeyPressed' | 'KeyReleased';
|
|
17
24
|
key: {
|
|
18
|
-
code:
|
|
19
|
-
codeStr:
|
|
25
|
+
code: Keys;
|
|
26
|
+
codeStr: KeysStr;
|
|
20
27
|
alt: boolean;
|
|
21
28
|
shift: boolean;
|
|
22
29
|
control: boolean;
|
|
@@ -46,7 +53,7 @@ interface MouseButtonEvent {
|
|
|
46
53
|
x: number;
|
|
47
54
|
y: number;
|
|
48
55
|
button: number;
|
|
49
|
-
buttonStr:
|
|
56
|
+
buttonStr: 'Left' | 'Right' | 'Middle' | 'XButton1' | 'XButton2';
|
|
50
57
|
};
|
|
51
58
|
}
|
|
52
59
|
|
|
@@ -66,9 +73,66 @@ interface MouseWheelScrollEvent {
|
|
|
66
73
|
y: number;
|
|
67
74
|
delta: number;
|
|
68
75
|
wheel: number;
|
|
69
|
-
wheelStr:
|
|
76
|
+
wheelStr: 'VerticalWheel' | 'HorizontalWheel';
|
|
70
77
|
};
|
|
71
78
|
}
|
|
72
79
|
|
|
73
|
-
|
|
74
|
-
|
|
80
|
+
interface JoystickButtonEvent {
|
|
81
|
+
type: 'JoystickButtonPressed' | 'JoystickButtonReleased';
|
|
82
|
+
joystickButton: {
|
|
83
|
+
joystickId: number;
|
|
84
|
+
button: number;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
interface JoystickConnectEvent {
|
|
89
|
+
type: 'JoystickConnected' | 'JoystickDisconnected';
|
|
90
|
+
joystickConnect: {
|
|
91
|
+
joystickId: number;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
interface JoystickMoveEvent {
|
|
96
|
+
type: 'JoystickMoved',
|
|
97
|
+
joystickMove: {
|
|
98
|
+
joystickId: number;
|
|
99
|
+
axis: Joystick.Axis;
|
|
100
|
+
axisStr: Joystick.AxisStr;
|
|
101
|
+
position: number;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
interface TouchEvent {
|
|
106
|
+
type: 'TouchBegan' | 'TouchMoved' | 'TouchEnded';
|
|
107
|
+
touch: {
|
|
108
|
+
finger: number;
|
|
109
|
+
x: number;
|
|
110
|
+
y: number;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
interface SensorEvent {
|
|
115
|
+
type: 'SensorChanged',
|
|
116
|
+
sensor: {
|
|
117
|
+
type: Sensor.Type;
|
|
118
|
+
typeStr: Sensor.TypeStr;
|
|
119
|
+
x: number;
|
|
120
|
+
y: number;
|
|
121
|
+
z: number;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export type Event =
|
|
126
|
+
| OtherEvent
|
|
127
|
+
| SizeEvent
|
|
128
|
+
| KeyEvent
|
|
129
|
+
| TextEvent
|
|
130
|
+
| MouseMoveEvent
|
|
131
|
+
| MouseButtonEvent
|
|
132
|
+
| MouseWheelEvent
|
|
133
|
+
| MouseWheelScrollEvent
|
|
134
|
+
| JoystickButtonEvent
|
|
135
|
+
| JoystickConnectEvent
|
|
136
|
+
| JoystickMoveEvent
|
|
137
|
+
| TouchEvent
|
|
138
|
+
| SensorEvent;
|
package/lib/rect.d.ts
CHANGED
package/lib/sensor.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Vector3F } from './vector3';
|
|
2
|
+
|
|
3
|
+
export enum Type {
|
|
4
|
+
Accelerometer = 0, Gyroscope = 1, Magnetometer = 2, Gravity = 3,
|
|
5
|
+
UserAcceleration = 4, Orientation = 5
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export type TypeStr = keyof typeof Type;
|
|
9
|
+
|
|
10
|
+
export function isAvailable(sensor: Type): boolean;
|
|
11
|
+
export function setEnabled(sensor: Type, enabled: boolean): void;
|
|
12
|
+
export function getValue(sensor: Type): Vector3F;
|
package/lib/sensor.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const {
|
|
4
|
+
sensorIsAvailable: _isAvailable,
|
|
5
|
+
sensorSetEnabled: _setEnabled,
|
|
6
|
+
sensorGetValue: _getValue,
|
|
7
|
+
sensorType: Type,
|
|
8
|
+
} = require('../build/Release/binding.node');
|
|
9
|
+
|
|
10
|
+
const SensorTypeValues = Object.values(Type);
|
|
11
|
+
|
|
12
|
+
const validateSensorType = sensor => {
|
|
13
|
+
if (!SensorTypeValues.includes(sensor)) {
|
|
14
|
+
throw new TypeError('Invalid Sensor::Type value.');
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
module.exports.isAvailable = sensor => {
|
|
19
|
+
validateSensorType(sensor);
|
|
20
|
+
return _isAvailable(sensor);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
module.exports.setEnabled = (sensor, enabled) => {
|
|
24
|
+
validateSensorType(sensor);
|
|
25
|
+
_setEnabled(sensor, !!enabled);
|
|
26
|
+
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
module.exports.getValue = sensor => {
|
|
30
|
+
validateSensorType(sensor);
|
|
31
|
+
return _getValue(sensor);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
module.exports.Type = Type;
|
package/lib/sfml.d.ts
CHANGED
|
@@ -4,6 +4,9 @@ export * from './font';
|
|
|
4
4
|
export * from './image';
|
|
5
5
|
export * as Keyboard from './keyboard';
|
|
6
6
|
export * as Mouse from './mouse';
|
|
7
|
+
export * as Joystick from './joystick';
|
|
8
|
+
export * as Sensor from './sensor';
|
|
9
|
+
export * as Touch from './touch';
|
|
7
10
|
export * from './rect';
|
|
8
11
|
export * from './render_window';
|
|
9
12
|
export * from './texture';
|
|
@@ -11,6 +14,7 @@ export * from './texture';
|
|
|
11
14
|
export * as Time from './time';
|
|
12
15
|
|
|
13
16
|
export * from './vector2';
|
|
17
|
+
export * from './vector3';
|
|
14
18
|
export * from './vertex';
|
|
15
19
|
export * from './video_mode';
|
|
16
20
|
|
package/lib/sfml.js
CHANGED
|
@@ -7,6 +7,9 @@ module.exports = {
|
|
|
7
7
|
...require('./image'),
|
|
8
8
|
Keyboard: require('./keyboard'),
|
|
9
9
|
Mouse: require('./mouse'),
|
|
10
|
+
Joystick: require('./joystick'),
|
|
11
|
+
Sensor: require('./sensor'),
|
|
12
|
+
Touch: require('./touch'),
|
|
10
13
|
...require('./render_window'),
|
|
11
14
|
...require('./texture'),
|
|
12
15
|
...require('./vertex'),
|
|
@@ -16,6 +19,7 @@ module.exports = {
|
|
|
16
19
|
|
|
17
20
|
...require('./rect'),
|
|
18
21
|
...require('./vector2'),
|
|
22
|
+
...require('./vector3'),
|
|
19
23
|
|
|
20
24
|
// drawable
|
|
21
25
|
...require('./drawable/circle_shape'),
|
package/lib/touch.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Vector2I } from './vector2';
|
|
2
|
+
import { RenderWindow } from './render_window';
|
|
3
|
+
|
|
4
|
+
type UnsignedInteger = number;
|
|
5
|
+
|
|
6
|
+
export function isDown(finger: UnsignedInteger): boolean;
|
|
7
|
+
export function getPosition(finger: UnsignedInteger, window?: RenderWindow): Vector2I;
|
package/lib/touch.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const {
|
|
4
|
+
touchGetPosition: _getPosition,
|
|
5
|
+
touchIsDown: _isDown,
|
|
6
|
+
} = require('../build/Release/binding.node');
|
|
7
|
+
const { RenderWindow } = require('./render_window');
|
|
8
|
+
|
|
9
|
+
const validateFinger = finger => {
|
|
10
|
+
if (!Number.isInteger(finger) || Math.sign(finger) < 0) {
|
|
11
|
+
throw new TypeError(
|
|
12
|
+
`Unexpected value ${finger} for finger, expected usigned integer.`
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
exports.isDown = finger => {
|
|
18
|
+
validateFinger(finger);
|
|
19
|
+
return _isDown(finger);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
exports.getPosition = function getPosition(finger, window) {
|
|
23
|
+
validateFinger(finger);
|
|
24
|
+
|
|
25
|
+
if (arguments.length === 1) {
|
|
26
|
+
return _getPosition(finger);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (!(window instanceof RenderWindow)) {
|
|
30
|
+
throw new TypeError('Parameter is not a RenderWindow instance.');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return _getPosition(finger, window[RenderWindow.RAW_RENDER_WINDOW]);
|
|
34
|
+
};
|
package/lib/vector3.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export class Vector3I {
|
|
2
|
+
constructor(x: number, y: number, z: number);
|
|
3
|
+
constructor(vec: Vector3I);
|
|
4
|
+
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
|
|
8
|
+
static add(a: Vector3I, b: Vector3I): Vector3I;
|
|
9
|
+
static subtract(a: Vector3I, b: Vector3I): Vector3I;
|
|
10
|
+
static multiply(a: Vector3I, b: number): Vector3I;
|
|
11
|
+
static div(a: Vector3I, b: number): Vector3I;
|
|
12
|
+
|
|
13
|
+
static equals(a: Vector3I, b: Vector3I): boolean;
|
|
14
|
+
static notEequals(a: Vector3I, b: Vector3I): boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export class Vector3U {
|
|
18
|
+
constructor(x: number, y: number, z: number);
|
|
19
|
+
constructor(vec: Vector3U);
|
|
20
|
+
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
|
|
24
|
+
static add(a: Vector3U, b: Vector3U): Vector3U;
|
|
25
|
+
static subtract(a: Vector3U, b: Vector3U): Vector3U;
|
|
26
|
+
static multiply(a: Vector3U, b: number): Vector3U;
|
|
27
|
+
static div(a: Vector3U, b: number): Vector3U;
|
|
28
|
+
|
|
29
|
+
static equals(a: Vector3U, b: Vector3U): boolean;
|
|
30
|
+
static notEequals(a: Vector3U, b: Vector3U): boolean;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export class Vector3F {
|
|
34
|
+
constructor(x: number, y: number, z: number);
|
|
35
|
+
constructor(vec: Vector3F);
|
|
36
|
+
|
|
37
|
+
x: number;
|
|
38
|
+
y: number;
|
|
39
|
+
|
|
40
|
+
static add(a: Vector3F, b: Vector3F): Vector3F;
|
|
41
|
+
static subtract(a: Vector3F, b: Vector3F): Vector3F;
|
|
42
|
+
static multiply(a: Vector3F, b: number): Vector3F;
|
|
43
|
+
static div(a: Vector3F, b: number): Vector3F;
|
|
44
|
+
|
|
45
|
+
static equals(a: Vector3F, b: Vector3F): boolean;
|
|
46
|
+
static notEequals(a: Vector3F, b: Vector3F): boolean;
|
|
47
|
+
}
|