sfml.js 0.0.1-preview.9 → 0.0.1
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 +56 -7
- package/binding.gyp +118 -17
- package/index.d.ts +1 -0
- package/lib/clock.d.ts +2 -4
- package/lib/clock.js +3 -1
- package/lib/color.d.ts +2 -2
- package/lib/color.js +58 -3
- package/lib/common.js +33 -7
- package/lib/drawable/circle_shape.d.ts +2 -2
- package/lib/drawable/circle_shape.js +3 -3
- package/lib/drawable/convex_shape.d.ts +5 -0
- package/lib/drawable/convex_shape.js +35 -0
- package/lib/drawable/drawable.d.ts +6 -0
- package/lib/drawable/{base.js → drawable.js} +7 -4
- package/lib/drawable/plugin_package.d.ts +31 -0
- package/lib/drawable/plugin_package.js +102 -0
- package/lib/drawable/rectangle_shape.d.ts +6 -3
- package/lib/drawable/rectangle_shape.js +14 -2
- package/lib/drawable/shape.d.ts +8 -32
- package/lib/drawable/shape.js +16 -115
- package/lib/drawable/sprite.d.ts +17 -0
- package/lib/drawable/sprite.js +53 -0
- package/lib/drawable/text.d.ts +26 -0
- package/lib/drawable/text.js +88 -0
- package/lib/drawable/transformable.d.ts +28 -0
- package/lib/drawable/transformable.js +113 -0
- package/lib/drawable/vertex_array.d.ts +40 -0
- package/lib/drawable/vertex_array.js +128 -0
- package/lib/font.d.ts +24 -0
- package/lib/font.js +137 -0
- package/lib/image.d.ts +26 -0
- package/lib/image.js +147 -0
- package/lib/joystick.d.ts +21 -0
- package/lib/joystick.js +72 -0
- package/lib/keyboard.d.ts +113 -0
- package/lib/keyboard.js +17 -0
- package/lib/mouse.d.ts +6 -0
- package/lib/mouse.js +39 -0
- package/lib/poll_event.d.ts +72 -10
- package/lib/rect.d.ts +2 -2
- package/lib/rect.js +29 -9
- package/lib/render_window.d.ts +54 -15
- package/lib/render_window.js +137 -7
- package/lib/sensor.d.ts +12 -0
- package/lib/sensor.js +34 -0
- package/lib/sfml.d.ts +32 -0
- package/lib/sfml.js +26 -9
- package/lib/sound/base.d.ts +33 -0
- package/lib/sound/base.js +109 -0
- package/lib/sound/music.d.ts +15 -0
- package/lib/sound/music.js +65 -0
- package/lib/sound/sound.d.ts +16 -0
- package/lib/sound/sound.js +55 -0
- package/lib/sound/sound_buffer.d.ts +14 -0
- package/lib/sound/sound_buffer.js +78 -0
- package/lib/texture.d.ts +21 -0
- package/lib/texture.js +127 -0
- package/lib/time.d.ts +2 -2
- package/lib/touch.d.ts +7 -0
- package/lib/touch.js +34 -0
- package/lib/vector2.d.ts +24 -0
- package/lib/vector2.js +85 -16
- package/lib/vector3.d.ts +47 -0
- package/lib/vector3.js +154 -0
- package/lib/vertex.d.ts +14 -0
- package/lib/vertex.js +177 -0
- package/lib/video_mode.d.ts +2 -4
- package/lib/video_mode.js +15 -5
- package/package.json +26 -38
- package/src/base_class_with_loading.h +21 -0
- package/src/clock.cc +12 -3
- package/src/clock.h +5 -2
- package/src/color.cc +18 -13
- package/src/color.h +9 -3
- package/src/drawable/circle_shape.cc +9 -9
- package/src/drawable/circle_shape.h +4 -1
- package/src/drawable/convex_shape.cc +57 -0
- package/src/drawable/convex_shape.h +29 -0
- package/src/drawable/drawable-inl.h +29 -0
- package/src/drawable/drawable.cc +41 -0
- package/src/drawable/drawable.h +26 -38
- package/src/drawable/package_plugin-inl.h +191 -0
- package/src/drawable/package_plugin.h +60 -0
- package/src/drawable/rectangle_shape.cc +43 -7
- package/src/drawable/rectangle_shape.h +7 -1
- package/src/drawable/shape.cc +67 -0
- package/src/drawable/shape.h +13 -28
- package/src/drawable/sprite.cc +122 -0
- package/src/drawable/sprite.h +45 -0
- package/src/drawable/text.cc +133 -0
- package/src/drawable/text.h +54 -0
- package/src/drawable/vertex_array.cc +248 -0
- package/src/drawable/vertex_array.h +46 -0
- package/src/font.cc +214 -0
- package/src/font.h +44 -0
- package/src/gen/joystick_axis.cc +30 -0
- package/src/gen/keycode.cc +12 -4
- package/src/gen/sensor_type.cc +26 -0
- package/src/image.cc +379 -0
- package/src/image.h +72 -0
- package/src/joystick.cc +132 -0
- package/src/joystick.h +32 -0
- package/src/keyboard.cc +50 -0
- package/src/keyboard.h +8 -1
- package/src/mouse.cc +80 -0
- package/src/mouse.h +9 -1
- package/src/plugins/transformable_plugin-inl.h +121 -0
- package/src/plugins/transformable_plugin.h +42 -0
- package/src/poll_event.cc +74 -1
- package/src/poll_event.h +2 -1
- package/src/rect-inl.h +21 -16
- package/src/rect.h +10 -8
- package/src/render_window.cc +249 -6
- package/src/render_window.h +70 -2
- package/src/render_window_async_display.cc +49 -0
- package/src/render_window_async_draw.cc +56 -0
- package/src/resizable_buffer.h +104 -0
- package/src/sensor.cc +82 -0
- package/src/sensor.h +28 -0
- package/src/sfml.cc +41 -0
- package/src/sound/music.cc +113 -0
- package/src/sound/music.h +35 -0
- package/src/sound/sound.cc +116 -0
- package/src/sound/sound.h +41 -0
- package/src/sound/sound_buffer.cc +226 -0
- package/src/sound/sound_buffer.h +46 -0
- package/src/sound/sound_source.cc +124 -0
- package/src/sound/sound_source.h +80 -0
- package/src/texture.cc +246 -0
- package/src/texture.h +47 -0
- package/src/time.cc +1 -1
- package/src/time.h +2 -1
- package/src/touch.cc +54 -0
- package/src/touch.h +23 -0
- package/src/utils-inl.h +19 -0
- package/src/utils.h +6 -0
- package/src/vector2-inl.h +101 -17
- package/src/vector2.cc +4 -3
- package/src/vector2.h +42 -12
- package/src/vector3-inl.h +200 -0
- package/src/vector3.cc +36 -0
- package/src/vector3.h +134 -0
- package/src/vertex.cc +238 -0
- package/src/vertex.h +114 -0
- package/src/video_mode.cc +9 -9
- package/src/video_mode.h +9 -2
- package/src/workers/load_from_file_worker.h +79 -0
- package/src/workers/save_to_file_worker.h +79 -0
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Audio/AlResource.hpp +1 -1
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Audio/Export.hpp +1 -1
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Audio/InputSoundFile.hpp +17 -12
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Audio/Listener.hpp +1 -1
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Audio/Music.hpp +10 -10
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Audio/OutputSoundFile.hpp +4 -4
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Audio/Sound.hpp +2 -2
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Audio/SoundBuffer.hpp +6 -6
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Audio/SoundBufferRecorder.hpp +3 -3
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Audio/SoundFileFactory.hpp +3 -3
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Audio/SoundFileFactory.inl +1 -1
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Audio/SoundFileReader.hpp +4 -4
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Audio/SoundFileWriter.hpp +1 -1
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Audio/SoundRecorder.hpp +12 -10
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Audio/SoundSource.hpp +5 -5
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Audio/SoundStream.hpp +34 -19
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Audio.hpp +1 -1
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Config.hpp +16 -4
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/GpuPreference.hpp +1 -1
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Graphics/BlendMode.hpp +28 -24
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Graphics/CircleShape.hpp +3 -3
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Graphics/Color.hpp +14 -14
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Graphics/ConvexShape.hpp +2 -2
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Graphics/Drawable.hpp +1 -1
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Graphics/Export.hpp +1 -1
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Graphics/Font.hpp +81 -24
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Graphics/Glsl.hpp +1 -1
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Graphics/Glsl.inl +6 -6
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Graphics/Glyph.hpp +7 -5
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Graphics/Image.hpp +34 -12
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Graphics/PrimitiveType.hpp +11 -11
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Graphics/Rect.hpp +25 -5
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Graphics/Rect.inl +13 -1
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Graphics/RectangleShape.hpp +2 -2
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Graphics/RenderStates.hpp +6 -6
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Graphics/RenderTarget.hpp +21 -13
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Graphics/RenderTexture.hpp +23 -3
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Graphics/RenderWindow.hpp +13 -2
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Graphics/Shader.hpp +8 -8
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Graphics/Shape.hpp +10 -10
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Graphics/Sprite.hpp +4 -4
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Graphics/Text.hpp +20 -20
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Graphics/Texture.hpp +13 -13
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Graphics/Transform.hpp +23 -5
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Graphics/Transformable.hpp +9 -9
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Graphics/Vertex.hpp +4 -4
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Graphics/VertexArray.hpp +3 -3
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Graphics/VertexBuffer.hpp +8 -8
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Graphics/View.hpp +9 -9
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Graphics.hpp +1 -1
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Main.hpp +1 -1
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Network/Export.hpp +1 -1
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Network/Ftp.hpp +53 -53
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Network/Http.hpp +44 -44
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Network/IpAddress.hpp +7 -7
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Network/Packet.hpp +18 -5
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Network/Socket.hpp +12 -12
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Network/SocketHandle.hpp +1 -1
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Network/SocketSelector.hpp +2 -2
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Network/TcpListener.hpp +5 -1
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Network/TcpSocket.hpp +6 -6
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Network/UdpSocket.hpp +7 -6
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Network.hpp +1 -1
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/OpenGL.hpp +2 -2
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/System/Clock.hpp +2 -2
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/System/Err.hpp +1 -1
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/System/Export.hpp +1 -1
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/System/FileInputStream.hpp +2 -2
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/System/InputStream.hpp +1 -1
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/System/Lock.hpp +2 -2
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/System/MemoryInputStream.hpp +4 -4
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/System/Mutex.hpp +2 -2
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/System/NativeActivity.hpp +1 -1
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/System/NonCopyable.hpp +1 -1
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/System/Sleep.hpp +1 -1
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/System/String.hpp +5 -5
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/System/String.inl +1 -1
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/System/Thread.hpp +3 -3
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/System/Thread.inl +1 -1
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/System/ThreadLocal.hpp +2 -2
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/System/ThreadLocalPtr.hpp +1 -1
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/System/ThreadLocalPtr.inl +1 -1
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/System/Time.hpp +3 -3
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/System/Utf.hpp +1 -1
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/System/Utf.inl +12 -12
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/System/Vector2.hpp +3 -3
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/System/Vector2.inl +1 -1
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/System/Vector3.hpp +4 -4
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/System/Vector3.inl +1 -1
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/System.hpp +1 -1
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Window/Clipboard.hpp +1 -1
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Window/Context.hpp +2 -2
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Window/ContextSettings.hpp +11 -11
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Window/Cursor.hpp +36 -17
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Window/Event.hpp +72 -71
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Window/Export.hpp +1 -1
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Window/GlResource.hpp +1 -1
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Window/Joystick.hpp +15 -15
- package/third_party/sfml/include/SFML/Window/Keyboard.hpp +491 -0
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Window/Mouse.hpp +15 -12
- package/third_party/{SFML-2.5.1 → sfml}/include/SFML/Window/Sensor.hpp +8 -8
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Window/Touch.hpp +3 -3
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Window/VideoMode.hpp +4 -4
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Window/GlResource.hpp → sfml/include/SFML/Window/Vulkan.hpp} +51 -45
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Window/Window.hpp +35 -303
- package/third_party/{SFML-2.5.1/include/SFML/Window/Window.hpp → sfml/include/SFML/Window/WindowBase.hpp} +60 -164
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Window/WindowHandle.hpp +2 -2
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Window/WindowStyle.hpp +7 -7
- package/third_party/{SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers → sfml/include/SFML}/Window.hpp +1 -1
- package/tools/clang_format.js +9 -0
- package/tools/copier/linux.js +21 -0
- package/tools/copier/macos.js +34 -0
- package/tools/copier/windows.js +33 -0
- package/tools/joystick_axis.js +63 -0
- package/tools/keycode.js +62 -19
- package/tools/lib_downloader.js +107 -0
- package/tools/lib_downloader_urls.js +59 -0
- package/tools/mouse_button.js +60 -37
- package/tools/sensor_type.js +63 -0
- package/tsconfig.json +8 -0
- package/lib/drawable/base.d.ts +0 -3
- package/src/drawable/shape-inl.h +0 -231
- package/third_party/SFML-2.5.1/include/SFML/Audio/Music.hpp +0 -337
- package/third_party/SFML-2.5.1/include/SFML/Audio/SoundFileFactory.hpp +0 -197
- package/third_party/SFML-2.5.1/include/SFML/Audio/SoundFileFactory.inl +0 -100
- package/third_party/SFML-2.5.1/include/SFML/Audio/SoundFileWriter.hpp +0 -125
- package/third_party/SFML-2.5.1/include/SFML/Audio/SoundRecorder.hpp +0 -408
- package/third_party/SFML-2.5.1/include/SFML/Audio/SoundSource.hpp +0 -332
- package/third_party/SFML-2.5.1/include/SFML/Audio.hpp +0 -56
- package/third_party/SFML-2.5.1/include/SFML/Config.hpp +0 -236
- package/third_party/SFML-2.5.1/include/SFML/GpuPreference.hpp +0 -74
- package/third_party/SFML-2.5.1/include/SFML/Graphics/BlendMode.hpp +0 -215
- package/third_party/SFML-2.5.1/include/SFML/Graphics/ConvexShape.hpp +0 -153
- package/third_party/SFML-2.5.1/include/SFML/Graphics/Drawable.hpp +0 -126
- package/third_party/SFML-2.5.1/include/SFML/Graphics/Export.hpp +0 -48
- package/third_party/SFML-2.5.1/include/SFML/Graphics/Font.hpp +0 -439
- package/third_party/SFML-2.5.1/include/SFML/Graphics/Glsl.hpp +0 -227
- package/third_party/SFML-2.5.1/include/SFML/Graphics/Rect.hpp +0 -254
- package/third_party/SFML-2.5.1/include/SFML/Graphics/Rect.inl +0 -159
- package/third_party/SFML-2.5.1/include/SFML/Graphics/RectangleShape.hpp +0 -132
- package/third_party/SFML-2.5.1/include/SFML/Graphics/RenderStates.hpp +0 -174
- package/third_party/SFML-2.5.1/include/SFML/Graphics/Shape.hpp +0 -355
- package/third_party/SFML-2.5.1/include/SFML/Graphics/Sprite.hpp +0 -279
- package/third_party/SFML-2.5.1/include/SFML/Graphics/Texture.hpp +0 -733
- package/third_party/SFML-2.5.1/include/SFML/Graphics/Transform.hpp +0 -479
- package/third_party/SFML-2.5.1/include/SFML/Graphics/Vertex.hpp +0 -148
- package/third_party/SFML-2.5.1/include/SFML/Graphics/VertexArray.hpp +0 -223
- package/third_party/SFML-2.5.1/include/SFML/Graphics.hpp +0 -68
- package/third_party/SFML-2.5.1/include/SFML/Network/Export.hpp +0 -48
- package/third_party/SFML-2.5.1/include/SFML/Network/Ftp.hpp +0 -616
- package/third_party/SFML-2.5.1/include/SFML/Network/Http.hpp +0 -482
- package/third_party/SFML-2.5.1/include/SFML/Network/IpAddress.hpp +0 -328
- package/third_party/SFML-2.5.1/include/SFML/Network/Socket.hpp +0 -219
- package/third_party/SFML-2.5.1/include/SFML/Network/SocketSelector.hpp +0 -263
- package/third_party/SFML-2.5.1/include/SFML/Network/TcpSocket.hpp +0 -316
- package/third_party/SFML-2.5.1/include/SFML/System/Err.hpp +0 -80
- package/third_party/SFML-2.5.1/include/SFML/System/InputStream.hpp +0 -152
- package/third_party/SFML-2.5.1/include/SFML/System/NativeActivity.hpp +0 -62
- package/third_party/SFML-2.5.1/include/SFML/System/NonCopyable.hpp +0 -129
- package/third_party/SFML-2.5.1/include/SFML/System/String.hpp +0 -669
- package/third_party/SFML-2.5.1/include/SFML/System/Thread.inl +0 -90
- package/third_party/SFML-2.5.1/include/SFML/System/ThreadLocalPtr.inl +0 -77
- package/third_party/SFML-2.5.1/include/SFML/System/Utf.hpp +0 -763
- package/third_party/SFML-2.5.1/include/SFML/System/Utf.inl +0 -752
- package/third_party/SFML-2.5.1/include/SFML/System/Vector2.hpp +0 -301
- package/third_party/SFML-2.5.1/include/SFML/System/Vector2.inl +0 -161
- package/third_party/SFML-2.5.1/include/SFML/Window/Context.hpp +0 -195
- package/third_party/SFML-2.5.1/include/SFML/Window/ContextSettings.hpp +0 -149
- package/third_party/SFML-2.5.1/include/SFML/Window/Cursor.hpp +0 -222
- package/third_party/SFML-2.5.1/include/SFML/Window/Event.hpp +0 -284
- package/third_party/SFML-2.5.1/include/SFML/Window/Export.hpp +0 -48
- package/third_party/SFML-2.5.1/include/SFML/Window/Keyboard.hpp +0 -232
- package/third_party/SFML-2.5.1/include/SFML/Window/Touch.hpp +0 -137
- package/third_party/SFML-2.5.1/include/SFML/Window/VideoMode.hpp +0 -228
- package/third_party/SFML-2.5.1/include/SFML/Window/WindowHandle.hpp +0 -101
- package/third_party/SFML-2.5.1/include/SFML/Window/WindowStyle.hpp +0 -53
- package/third_party/SFML-2.5.1/include/SFML/Window.hpp +0 -58
- package/third_party/SFML-2.5.1/lib/libsfml-audio.so.2.5.1 +0 -0
- package/third_party/SFML-2.5.1/lib/libsfml-graphics.so.2.5.1 +0 -0
- package/third_party/SFML-2.5.1/lib/libsfml-network.so.2.5.1 +0 -0
- package/third_party/SFML-2.5.1/lib/libsfml-system.so.2.5.1 +0 -0
- package/third_party/SFML-2.5.1/lib/libsfml-window.so.2.5.1 +0 -0
- package/third_party/SFML-2.5.1/macOS/Frameworks/FLAC.framework/Versions/A/FLAC +0 -0
- package/third_party/SFML-2.5.1/macOS/Frameworks/FLAC.framework/Versions/A/Resources/Info.plist +0 -22
- package/third_party/SFML-2.5.1/macOS/Frameworks/OpenAL.framework/Versions/A/OpenAL +0 -0
- package/third_party/SFML-2.5.1/macOS/Frameworks/OpenAL.framework/Versions/A/Resources/Info.plist +0 -22
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Audio/AlResource.hpp +0 -70
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Audio/Export.hpp +0 -48
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Audio/InputSoundFile.hpp +0 -263
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Audio/Listener.hpp +0 -234
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Audio/OutputSoundFile.hpp +0 -133
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Audio/Sound.hpp +0 -264
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Audio/SoundBuffer.hpp +0 -352
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Audio/SoundBufferRecorder.hpp +0 -144
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Audio/SoundFileReader.hpp +0 -165
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Audio/SoundStream.hpp +0 -405
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/CircleShape.hpp +0 -154
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/Color.hpp +0 -275
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/Glsl.inl +0 -155
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/Glyph.hpp +0 -79
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/Image.hpp +0 -324
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/PrimitiveType.hpp +0 -58
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/RenderTarget.hpp +0 -510
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/RenderTexture.hpp +0 -314
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/RenderWindow.hpp +0 -284
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/Shader.hpp +0 -875
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/Text.hpp +0 -513
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/Transformable.hpp +0 -429
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/VertexBuffer.hpp +0 -408
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Graphics/View.hpp +0 -343
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Main.hpp +0 -43
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Network/Packet.hpp +0 -532
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Network/SocketHandle.hpp +0 -57
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Network/TcpListener.hpp +0 -166
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Network/UdpSocket.hpp +0 -291
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Network.hpp +0 -53
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/OpenGL.hpp +0 -78
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/Clock.hpp +0 -117
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/Export.hpp +0 -48
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/FileInputStream.hpp +0 -169
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/Lock.hpp +0 -139
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/MemoryInputStream.hpp +0 -148
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/Mutex.hpp +0 -148
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/Sleep.hpp +0 -52
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/String.inl +0 -53
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/Thread.hpp +0 -282
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/ThreadLocal.hpp +0 -103
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/ThreadLocalPtr.hpp +0 -158
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/Time.hpp +0 -488
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/Vector3.hpp +0 -302
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System/Vector3.inl +0 -168
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/System.hpp +0 -60
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Window/Clipboard.hpp +0 -119
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Window/Joystick.hpp +0 -227
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Window/Keyboard.hpp +0 -232
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Window/Mouse.hpp +0 -177
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Headers/Window/Sensor.hpp +0 -150
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Resources/CMake/SFMLConfig.cmake +0 -148
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Resources/CMake/SFMLConfigDependencies.cmake +0 -86
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Resources/CMake/SFMLConfigVersion.cmake +0 -46
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Resources/CMake/SFMLSharedTargets-release.cmake +0 -59
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Resources/CMake/SFMLSharedTargets.cmake +0 -158
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/Resources/Info.plist +0 -26
- package/third_party/SFML-2.5.1/macOS/Frameworks/SFML.framework/Versions/2.5.1/SFML +0 -0
- package/third_party/SFML-2.5.1/macOS/Frameworks/freetype.framework/Versions/A/Resources/Info.plist +0 -22
- package/third_party/SFML-2.5.1/macOS/Frameworks/freetype.framework/Versions/A/freetype +0 -0
- package/third_party/SFML-2.5.1/macOS/Frameworks/ogg.framework/Versions/A/Resources/Info.plist +0 -22
- package/third_party/SFML-2.5.1/macOS/Frameworks/ogg.framework/Versions/A/ogg +0 -0
- package/third_party/SFML-2.5.1/macOS/Frameworks/sfml-audio.framework/Versions/2.5.1/Resources/Info.plist +0 -26
- package/third_party/SFML-2.5.1/macOS/Frameworks/sfml-audio.framework/Versions/2.5.1/sfml-audio +0 -0
- package/third_party/SFML-2.5.1/macOS/Frameworks/sfml-graphics.framework/Versions/2.5.1/Resources/Info.plist +0 -26
- package/third_party/SFML-2.5.1/macOS/Frameworks/sfml-graphics.framework/Versions/2.5.1/sfml-graphics +0 -0
- package/third_party/SFML-2.5.1/macOS/Frameworks/sfml-network.framework/Versions/2.5.1/Resources/Info.plist +0 -26
- package/third_party/SFML-2.5.1/macOS/Frameworks/sfml-network.framework/Versions/2.5.1/sfml-network +0 -0
- package/third_party/SFML-2.5.1/macOS/Frameworks/sfml-system.framework/Versions/2.5.1/Resources/Info.plist +0 -26
- package/third_party/SFML-2.5.1/macOS/Frameworks/sfml-system.framework/Versions/2.5.1/sfml-system +0 -0
- package/third_party/SFML-2.5.1/macOS/Frameworks/sfml-window.framework/Versions/2.5.1/Resources/Info.plist +0 -26
- package/third_party/SFML-2.5.1/macOS/Frameworks/sfml-window.framework/Versions/2.5.1/sfml-window +0 -0
- package/third_party/SFML-2.5.1/macOS/Frameworks/vorbis.framework/Versions/A/Resources/Info.plist +0 -22
- package/third_party/SFML-2.5.1/macOS/Frameworks/vorbis.framework/Versions/A/vorbis +0 -0
- package/third_party/SFML-2.5.1/macOS/Frameworks/vorbisenc.framework/Versions/A/Resources/Info.plist +0 -22
- package/third_party/SFML-2.5.1/macOS/Frameworks/vorbisenc.framework/Versions/A/vorbisenc +0 -0
- package/third_party/SFML-2.5.1/macOS/Frameworks/vorbisfile.framework/Versions/A/Resources/Info.plist +0 -22
- package/third_party/SFML-2.5.1/macOS/Frameworks/vorbisfile.framework/Versions/A/vorbisfile +0 -0
- package/third_party/SFML-2.5.1/macOS/lib/libsfml-audio.2.5.1.dylib +0 -0
- package/third_party/SFML-2.5.1/macOS/lib/libsfml-graphics.2.5.1.dylib +0 -0
- package/third_party/SFML-2.5.1/macOS/lib/libsfml-network.2.5.1.dylib +0 -0
- package/third_party/SFML-2.5.1/macOS/lib/libsfml-system.2.5.1.dylib +0 -0
- package/third_party/SFML-2.5.1/macOS/lib/libsfml-window.2.5.1.dylib +0 -0
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
////////////////////////////////////////////////////////////
|
|
2
|
-
//
|
|
3
|
-
// SFML - Simple and Fast Multimedia Library
|
|
4
|
-
// Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org)
|
|
5
|
-
//
|
|
6
|
-
// This software is provided 'as-is', without any express or implied warranty.
|
|
7
|
-
// In no event will the authors be held liable for any damages arising from the use of this software.
|
|
8
|
-
//
|
|
9
|
-
// Permission is granted to anyone to use this software for any purpose,
|
|
10
|
-
// including commercial applications, and to alter it and redistribute it freely,
|
|
11
|
-
// subject to the following restrictions:
|
|
12
|
-
//
|
|
13
|
-
// 1. The origin of this software must not be misrepresented;
|
|
14
|
-
// you must not claim that you wrote the original software.
|
|
15
|
-
// If you use this software in a product, an acknowledgment
|
|
16
|
-
// in the product documentation would be appreciated but is not required.
|
|
17
|
-
//
|
|
18
|
-
// 2. Altered source versions must be plainly marked as such,
|
|
19
|
-
// and must not be misrepresented as being the original software.
|
|
20
|
-
//
|
|
21
|
-
// 3. This notice may not be removed or altered from any source distribution.
|
|
22
|
-
//
|
|
23
|
-
////////////////////////////////////////////////////////////
|
|
24
|
-
|
|
25
|
-
#ifndef SFML_SOUND_HPP
|
|
26
|
-
#define SFML_SOUND_HPP
|
|
27
|
-
|
|
28
|
-
////////////////////////////////////////////////////////////
|
|
29
|
-
// Headers
|
|
30
|
-
////////////////////////////////////////////////////////////
|
|
31
|
-
#include <SFML/Audio/Export.hpp>
|
|
32
|
-
#include <SFML/Audio/SoundSource.hpp>
|
|
33
|
-
#include <SFML/System/Time.hpp>
|
|
34
|
-
#include <cstdlib>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
namespace sf
|
|
38
|
-
{
|
|
39
|
-
class SoundBuffer;
|
|
40
|
-
|
|
41
|
-
////////////////////////////////////////////////////////////
|
|
42
|
-
/// \brief Regular sound that can be played in the audio environment
|
|
43
|
-
///
|
|
44
|
-
////////////////////////////////////////////////////////////
|
|
45
|
-
class SFML_AUDIO_API Sound : public SoundSource
|
|
46
|
-
{
|
|
47
|
-
public:
|
|
48
|
-
|
|
49
|
-
////////////////////////////////////////////////////////////
|
|
50
|
-
/// \brief Default constructor
|
|
51
|
-
///
|
|
52
|
-
////////////////////////////////////////////////////////////
|
|
53
|
-
Sound();
|
|
54
|
-
|
|
55
|
-
////////////////////////////////////////////////////////////
|
|
56
|
-
/// \brief Construct the sound with a buffer
|
|
57
|
-
///
|
|
58
|
-
/// \param buffer Sound buffer containing the audio data to play with the sound
|
|
59
|
-
///
|
|
60
|
-
////////////////////////////////////////////////////////////
|
|
61
|
-
explicit Sound(const SoundBuffer& buffer);
|
|
62
|
-
|
|
63
|
-
////////////////////////////////////////////////////////////
|
|
64
|
-
/// \brief Copy constructor
|
|
65
|
-
///
|
|
66
|
-
/// \param copy Instance to copy
|
|
67
|
-
///
|
|
68
|
-
////////////////////////////////////////////////////////////
|
|
69
|
-
Sound(const Sound& copy);
|
|
70
|
-
|
|
71
|
-
////////////////////////////////////////////////////////////
|
|
72
|
-
/// \brief Destructor
|
|
73
|
-
///
|
|
74
|
-
////////////////////////////////////////////////////////////
|
|
75
|
-
~Sound();
|
|
76
|
-
|
|
77
|
-
////////////////////////////////////////////////////////////
|
|
78
|
-
/// \brief Start or resume playing the sound
|
|
79
|
-
///
|
|
80
|
-
/// This function starts the stream if it was stopped, resumes
|
|
81
|
-
/// it if it was paused, and restarts it from beginning if it
|
|
82
|
-
/// was it already playing.
|
|
83
|
-
/// This function uses its own thread so that it doesn't block
|
|
84
|
-
/// the rest of the program while the sound is played.
|
|
85
|
-
///
|
|
86
|
-
/// \see pause, stop
|
|
87
|
-
///
|
|
88
|
-
////////////////////////////////////////////////////////////
|
|
89
|
-
void play();
|
|
90
|
-
|
|
91
|
-
////////////////////////////////////////////////////////////
|
|
92
|
-
/// \brief Pause the sound
|
|
93
|
-
///
|
|
94
|
-
/// This function pauses the sound if it was playing,
|
|
95
|
-
/// otherwise (sound already paused or stopped) it has no effect.
|
|
96
|
-
///
|
|
97
|
-
/// \see play, stop
|
|
98
|
-
///
|
|
99
|
-
////////////////////////////////////////////////////////////
|
|
100
|
-
void pause();
|
|
101
|
-
|
|
102
|
-
////////////////////////////////////////////////////////////
|
|
103
|
-
/// \brief stop playing the sound
|
|
104
|
-
///
|
|
105
|
-
/// This function stops the sound if it was playing or paused,
|
|
106
|
-
/// and does nothing if it was already stopped.
|
|
107
|
-
/// It also resets the playing position (unlike pause()).
|
|
108
|
-
///
|
|
109
|
-
/// \see play, pause
|
|
110
|
-
///
|
|
111
|
-
////////////////////////////////////////////////////////////
|
|
112
|
-
void stop();
|
|
113
|
-
|
|
114
|
-
////////////////////////////////////////////////////////////
|
|
115
|
-
/// \brief Set the source buffer containing the audio data to play
|
|
116
|
-
///
|
|
117
|
-
/// It is important to note that the sound buffer is not copied,
|
|
118
|
-
/// thus the sf::SoundBuffer instance must remain alive as long
|
|
119
|
-
/// as it is attached to the sound.
|
|
120
|
-
///
|
|
121
|
-
/// \param buffer Sound buffer to attach to the sound
|
|
122
|
-
///
|
|
123
|
-
/// \see getBuffer
|
|
124
|
-
///
|
|
125
|
-
////////////////////////////////////////////////////////////
|
|
126
|
-
void setBuffer(const SoundBuffer& buffer);
|
|
127
|
-
|
|
128
|
-
////////////////////////////////////////////////////////////
|
|
129
|
-
/// \brief Set whether or not the sound should loop after reaching the end
|
|
130
|
-
///
|
|
131
|
-
/// If set, the sound will restart from beginning after
|
|
132
|
-
/// reaching the end and so on, until it is stopped or
|
|
133
|
-
/// setLoop(false) is called.
|
|
134
|
-
/// The default looping state for sound is false.
|
|
135
|
-
///
|
|
136
|
-
/// \param loop True to play in loop, false to play once
|
|
137
|
-
///
|
|
138
|
-
/// \see getLoop
|
|
139
|
-
///
|
|
140
|
-
////////////////////////////////////////////////////////////
|
|
141
|
-
void setLoop(bool loop);
|
|
142
|
-
|
|
143
|
-
////////////////////////////////////////////////////////////
|
|
144
|
-
/// \brief Change the current playing position of the sound
|
|
145
|
-
///
|
|
146
|
-
/// The playing position can be changed when the sound is
|
|
147
|
-
/// either paused or playing. Changing the playing position
|
|
148
|
-
/// when the sound is stopped has no effect, since playing
|
|
149
|
-
/// the sound will reset its position.
|
|
150
|
-
///
|
|
151
|
-
/// \param timeOffset New playing position, from the beginning of the sound
|
|
152
|
-
///
|
|
153
|
-
/// \see getPlayingOffset
|
|
154
|
-
///
|
|
155
|
-
////////////////////////////////////////////////////////////
|
|
156
|
-
void setPlayingOffset(Time timeOffset);
|
|
157
|
-
|
|
158
|
-
////////////////////////////////////////////////////////////
|
|
159
|
-
/// \brief Get the audio buffer attached to the sound
|
|
160
|
-
///
|
|
161
|
-
/// \return Sound buffer attached to the sound (can be NULL)
|
|
162
|
-
///
|
|
163
|
-
////////////////////////////////////////////////////////////
|
|
164
|
-
const SoundBuffer* getBuffer() const;
|
|
165
|
-
|
|
166
|
-
////////////////////////////////////////////////////////////
|
|
167
|
-
/// \brief Tell whether or not the sound is in loop mode
|
|
168
|
-
///
|
|
169
|
-
/// \return True if the sound is looping, false otherwise
|
|
170
|
-
///
|
|
171
|
-
/// \see setLoop
|
|
172
|
-
///
|
|
173
|
-
////////////////////////////////////////////////////////////
|
|
174
|
-
bool getLoop() const;
|
|
175
|
-
|
|
176
|
-
////////////////////////////////////////////////////////////
|
|
177
|
-
/// \brief Get the current playing position of the sound
|
|
178
|
-
///
|
|
179
|
-
/// \return Current playing position, from the beginning of the sound
|
|
180
|
-
///
|
|
181
|
-
/// \see setPlayingOffset
|
|
182
|
-
///
|
|
183
|
-
////////////////////////////////////////////////////////////
|
|
184
|
-
Time getPlayingOffset() const;
|
|
185
|
-
|
|
186
|
-
////////////////////////////////////////////////////////////
|
|
187
|
-
/// \brief Get the current status of the sound (stopped, paused, playing)
|
|
188
|
-
///
|
|
189
|
-
/// \return Current status of the sound
|
|
190
|
-
///
|
|
191
|
-
////////////////////////////////////////////////////////////
|
|
192
|
-
Status getStatus() const;
|
|
193
|
-
|
|
194
|
-
////////////////////////////////////////////////////////////
|
|
195
|
-
/// \brief Overload of assignment operator
|
|
196
|
-
///
|
|
197
|
-
/// \param right Instance to assign
|
|
198
|
-
///
|
|
199
|
-
/// \return Reference to self
|
|
200
|
-
///
|
|
201
|
-
////////////////////////////////////////////////////////////
|
|
202
|
-
Sound& operator =(const Sound& right);
|
|
203
|
-
|
|
204
|
-
////////////////////////////////////////////////////////////
|
|
205
|
-
/// \brief Reset the internal buffer of the sound
|
|
206
|
-
///
|
|
207
|
-
/// This function is for internal use only, you don't have
|
|
208
|
-
/// to use it. It is called by the sf::SoundBuffer that
|
|
209
|
-
/// this sound uses, when it is destroyed in order to prevent
|
|
210
|
-
/// the sound from using a dead buffer.
|
|
211
|
-
///
|
|
212
|
-
////////////////////////////////////////////////////////////
|
|
213
|
-
void resetBuffer();
|
|
214
|
-
|
|
215
|
-
private:
|
|
216
|
-
|
|
217
|
-
////////////////////////////////////////////////////////////
|
|
218
|
-
// Member data
|
|
219
|
-
////////////////////////////////////////////////////////////
|
|
220
|
-
const SoundBuffer* m_buffer; ///< Sound buffer bound to the source
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
} // namespace sf
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
#endif // SFML_SOUND_HPP
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
////////////////////////////////////////////////////////////
|
|
230
|
-
/// \class sf::Sound
|
|
231
|
-
/// \ingroup audio
|
|
232
|
-
///
|
|
233
|
-
/// sf::Sound is the class to use to play sounds.
|
|
234
|
-
/// It provides:
|
|
235
|
-
/// \li Control (play, pause, stop)
|
|
236
|
-
/// \li Ability to modify output parameters in real-time (pitch, volume, ...)
|
|
237
|
-
/// \li 3D spatial features (position, attenuation, ...).
|
|
238
|
-
///
|
|
239
|
-
/// sf::Sound is perfect for playing short sounds that can
|
|
240
|
-
/// fit in memory and require no latency, like foot steps or
|
|
241
|
-
/// gun shots. For longer sounds, like background musics
|
|
242
|
-
/// or long speeches, rather see sf::Music (which is based
|
|
243
|
-
/// on streaming).
|
|
244
|
-
///
|
|
245
|
-
/// In order to work, a sound must be given a buffer of audio
|
|
246
|
-
/// data to play. Audio data (samples) is stored in sf::SoundBuffer,
|
|
247
|
-
/// and attached to a sound with the setBuffer() function.
|
|
248
|
-
/// The buffer object attached to a sound must remain alive
|
|
249
|
-
/// as long as the sound uses it. Note that multiple sounds
|
|
250
|
-
/// can use the same sound buffer at the same time.
|
|
251
|
-
///
|
|
252
|
-
/// Usage example:
|
|
253
|
-
/// \code
|
|
254
|
-
/// sf::SoundBuffer buffer;
|
|
255
|
-
/// buffer.loadFromFile("sound.wav");
|
|
256
|
-
///
|
|
257
|
-
/// sf::Sound sound;
|
|
258
|
-
/// sound.setBuffer(buffer);
|
|
259
|
-
/// sound.play();
|
|
260
|
-
/// \endcode
|
|
261
|
-
///
|
|
262
|
-
/// \see sf::SoundBuffer, sf::Music
|
|
263
|
-
///
|
|
264
|
-
////////////////////////////////////////////////////////////
|
|
@@ -1,352 +0,0 @@
|
|
|
1
|
-
////////////////////////////////////////////////////////////
|
|
2
|
-
//
|
|
3
|
-
// SFML - Simple and Fast Multimedia Library
|
|
4
|
-
// Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org)
|
|
5
|
-
//
|
|
6
|
-
// This software is provided 'as-is', without any express or implied warranty.
|
|
7
|
-
// In no event will the authors be held liable for any damages arising from the use of this software.
|
|
8
|
-
//
|
|
9
|
-
// Permission is granted to anyone to use this software for any purpose,
|
|
10
|
-
// including commercial applications, and to alter it and redistribute it freely,
|
|
11
|
-
// subject to the following restrictions:
|
|
12
|
-
//
|
|
13
|
-
// 1. The origin of this software must not be misrepresented;
|
|
14
|
-
// you must not claim that you wrote the original software.
|
|
15
|
-
// If you use this software in a product, an acknowledgment
|
|
16
|
-
// in the product documentation would be appreciated but is not required.
|
|
17
|
-
//
|
|
18
|
-
// 2. Altered source versions must be plainly marked as such,
|
|
19
|
-
// and must not be misrepresented as being the original software.
|
|
20
|
-
//
|
|
21
|
-
// 3. This notice may not be removed or altered from any source distribution.
|
|
22
|
-
//
|
|
23
|
-
////////////////////////////////////////////////////////////
|
|
24
|
-
|
|
25
|
-
#ifndef SFML_SOUNDBUFFER_HPP
|
|
26
|
-
#define SFML_SOUNDBUFFER_HPP
|
|
27
|
-
|
|
28
|
-
////////////////////////////////////////////////////////////
|
|
29
|
-
// Headers
|
|
30
|
-
////////////////////////////////////////////////////////////
|
|
31
|
-
#include <SFML/Audio/Export.hpp>
|
|
32
|
-
#include <SFML/Audio/AlResource.hpp>
|
|
33
|
-
#include <SFML/System/Time.hpp>
|
|
34
|
-
#include <string>
|
|
35
|
-
#include <vector>
|
|
36
|
-
#include <set>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
namespace sf
|
|
40
|
-
{
|
|
41
|
-
class Sound;
|
|
42
|
-
class InputSoundFile;
|
|
43
|
-
class InputStream;
|
|
44
|
-
|
|
45
|
-
////////////////////////////////////////////////////////////
|
|
46
|
-
/// \brief Storage for audio samples defining a sound
|
|
47
|
-
///
|
|
48
|
-
////////////////////////////////////////////////////////////
|
|
49
|
-
class SFML_AUDIO_API SoundBuffer : AlResource
|
|
50
|
-
{
|
|
51
|
-
public:
|
|
52
|
-
|
|
53
|
-
////////////////////////////////////////////////////////////
|
|
54
|
-
/// \brief Default constructor
|
|
55
|
-
///
|
|
56
|
-
////////////////////////////////////////////////////////////
|
|
57
|
-
SoundBuffer();
|
|
58
|
-
|
|
59
|
-
////////////////////////////////////////////////////////////
|
|
60
|
-
/// \brief Copy constructor
|
|
61
|
-
///
|
|
62
|
-
/// \param copy Instance to copy
|
|
63
|
-
///
|
|
64
|
-
////////////////////////////////////////////////////////////
|
|
65
|
-
SoundBuffer(const SoundBuffer& copy);
|
|
66
|
-
|
|
67
|
-
////////////////////////////////////////////////////////////
|
|
68
|
-
/// \brief Destructor
|
|
69
|
-
///
|
|
70
|
-
////////////////////////////////////////////////////////////
|
|
71
|
-
~SoundBuffer();
|
|
72
|
-
|
|
73
|
-
////////////////////////////////////////////////////////////
|
|
74
|
-
/// \brief Load the sound buffer from a file
|
|
75
|
-
///
|
|
76
|
-
/// See the documentation of sf::InputSoundFile for the list
|
|
77
|
-
/// of supported formats.
|
|
78
|
-
///
|
|
79
|
-
/// \param filename Path of the sound file to load
|
|
80
|
-
///
|
|
81
|
-
/// \return True if loading succeeded, false if it failed
|
|
82
|
-
///
|
|
83
|
-
/// \see loadFromMemory, loadFromStream, loadFromSamples, saveToFile
|
|
84
|
-
///
|
|
85
|
-
////////////////////////////////////////////////////////////
|
|
86
|
-
bool loadFromFile(const std::string& filename);
|
|
87
|
-
|
|
88
|
-
////////////////////////////////////////////////////////////
|
|
89
|
-
/// \brief Load the sound buffer from a file in memory
|
|
90
|
-
///
|
|
91
|
-
/// See the documentation of sf::InputSoundFile for the list
|
|
92
|
-
/// of supported formats.
|
|
93
|
-
///
|
|
94
|
-
/// \param data Pointer to the file data in memory
|
|
95
|
-
/// \param sizeInBytes Size of the data to load, in bytes
|
|
96
|
-
///
|
|
97
|
-
/// \return True if loading succeeded, false if it failed
|
|
98
|
-
///
|
|
99
|
-
/// \see loadFromFile, loadFromStream, loadFromSamples
|
|
100
|
-
///
|
|
101
|
-
////////////////////////////////////////////////////////////
|
|
102
|
-
bool loadFromMemory(const void* data, std::size_t sizeInBytes);
|
|
103
|
-
|
|
104
|
-
////////////////////////////////////////////////////////////
|
|
105
|
-
/// \brief Load the sound buffer from a custom stream
|
|
106
|
-
///
|
|
107
|
-
/// See the documentation of sf::InputSoundFile for the list
|
|
108
|
-
/// of supported formats.
|
|
109
|
-
///
|
|
110
|
-
/// \param stream Source stream to read from
|
|
111
|
-
///
|
|
112
|
-
/// \return True if loading succeeded, false if it failed
|
|
113
|
-
///
|
|
114
|
-
/// \see loadFromFile, loadFromMemory, loadFromSamples
|
|
115
|
-
///
|
|
116
|
-
////////////////////////////////////////////////////////////
|
|
117
|
-
bool loadFromStream(InputStream& stream);
|
|
118
|
-
|
|
119
|
-
////////////////////////////////////////////////////////////
|
|
120
|
-
/// \brief Load the sound buffer from an array of audio samples
|
|
121
|
-
///
|
|
122
|
-
/// The assumed format of the audio samples is 16 bits signed integer
|
|
123
|
-
/// (sf::Int16).
|
|
124
|
-
///
|
|
125
|
-
/// \param samples Pointer to the array of samples in memory
|
|
126
|
-
/// \param sampleCount Number of samples in the array
|
|
127
|
-
/// \param channelCount Number of channels (1 = mono, 2 = stereo, ...)
|
|
128
|
-
/// \param sampleRate Sample rate (number of samples to play per second)
|
|
129
|
-
///
|
|
130
|
-
/// \return True if loading succeeded, false if it failed
|
|
131
|
-
///
|
|
132
|
-
/// \see loadFromFile, loadFromMemory, saveToFile
|
|
133
|
-
///
|
|
134
|
-
////////////////////////////////////////////////////////////
|
|
135
|
-
bool loadFromSamples(const Int16* samples, Uint64 sampleCount, unsigned int channelCount, unsigned int sampleRate);
|
|
136
|
-
|
|
137
|
-
////////////////////////////////////////////////////////////
|
|
138
|
-
/// \brief Save the sound buffer to an audio file
|
|
139
|
-
///
|
|
140
|
-
/// See the documentation of sf::OutputSoundFile for the list
|
|
141
|
-
/// of supported formats.
|
|
142
|
-
///
|
|
143
|
-
/// \param filename Path of the sound file to write
|
|
144
|
-
///
|
|
145
|
-
/// \return True if saving succeeded, false if it failed
|
|
146
|
-
///
|
|
147
|
-
/// \see loadFromFile, loadFromMemory, loadFromSamples
|
|
148
|
-
///
|
|
149
|
-
////////////////////////////////////////////////////////////
|
|
150
|
-
bool saveToFile(const std::string& filename) const;
|
|
151
|
-
|
|
152
|
-
////////////////////////////////////////////////////////////
|
|
153
|
-
/// \brief Get the array of audio samples stored in the buffer
|
|
154
|
-
///
|
|
155
|
-
/// The format of the returned samples is 16 bits signed integer
|
|
156
|
-
/// (sf::Int16). The total number of samples in this array
|
|
157
|
-
/// is given by the getSampleCount() function.
|
|
158
|
-
///
|
|
159
|
-
/// \return Read-only pointer to the array of sound samples
|
|
160
|
-
///
|
|
161
|
-
/// \see getSampleCount
|
|
162
|
-
///
|
|
163
|
-
////////////////////////////////////////////////////////////
|
|
164
|
-
const Int16* getSamples() const;
|
|
165
|
-
|
|
166
|
-
////////////////////////////////////////////////////////////
|
|
167
|
-
/// \brief Get the number of samples stored in the buffer
|
|
168
|
-
///
|
|
169
|
-
/// The array of samples can be accessed with the getSamples()
|
|
170
|
-
/// function.
|
|
171
|
-
///
|
|
172
|
-
/// \return Number of samples
|
|
173
|
-
///
|
|
174
|
-
/// \see getSamples
|
|
175
|
-
///
|
|
176
|
-
////////////////////////////////////////////////////////////
|
|
177
|
-
Uint64 getSampleCount() const;
|
|
178
|
-
|
|
179
|
-
////////////////////////////////////////////////////////////
|
|
180
|
-
/// \brief Get the sample rate of the sound
|
|
181
|
-
///
|
|
182
|
-
/// The sample rate is the number of samples played per second.
|
|
183
|
-
/// The higher, the better the quality (for example, 44100
|
|
184
|
-
/// samples/s is CD quality).
|
|
185
|
-
///
|
|
186
|
-
/// \return Sample rate (number of samples per second)
|
|
187
|
-
///
|
|
188
|
-
/// \see getChannelCount, getDuration
|
|
189
|
-
///
|
|
190
|
-
////////////////////////////////////////////////////////////
|
|
191
|
-
unsigned int getSampleRate() const;
|
|
192
|
-
|
|
193
|
-
////////////////////////////////////////////////////////////
|
|
194
|
-
/// \brief Get the number of channels used by the sound
|
|
195
|
-
///
|
|
196
|
-
/// If the sound is mono then the number of channels will
|
|
197
|
-
/// be 1, 2 for stereo, etc.
|
|
198
|
-
///
|
|
199
|
-
/// \return Number of channels
|
|
200
|
-
///
|
|
201
|
-
/// \see getSampleRate, getDuration
|
|
202
|
-
///
|
|
203
|
-
////////////////////////////////////////////////////////////
|
|
204
|
-
unsigned int getChannelCount() const;
|
|
205
|
-
|
|
206
|
-
////////////////////////////////////////////////////////////
|
|
207
|
-
/// \brief Get the total duration of the sound
|
|
208
|
-
///
|
|
209
|
-
/// \return Sound duration
|
|
210
|
-
///
|
|
211
|
-
/// \see getSampleRate, getChannelCount
|
|
212
|
-
///
|
|
213
|
-
////////////////////////////////////////////////////////////
|
|
214
|
-
Time getDuration() const;
|
|
215
|
-
|
|
216
|
-
////////////////////////////////////////////////////////////
|
|
217
|
-
/// \brief Overload of assignment operator
|
|
218
|
-
///
|
|
219
|
-
/// \param right Instance to assign
|
|
220
|
-
///
|
|
221
|
-
/// \return Reference to self
|
|
222
|
-
///
|
|
223
|
-
////////////////////////////////////////////////////////////
|
|
224
|
-
SoundBuffer& operator =(const SoundBuffer& right);
|
|
225
|
-
|
|
226
|
-
private:
|
|
227
|
-
|
|
228
|
-
friend class Sound;
|
|
229
|
-
|
|
230
|
-
////////////////////////////////////////////////////////////
|
|
231
|
-
/// \brief Initialize the internal state after loading a new sound
|
|
232
|
-
///
|
|
233
|
-
/// \param file Sound file providing access to the new loaded sound
|
|
234
|
-
///
|
|
235
|
-
/// \return True on successful initialization, false on failure
|
|
236
|
-
///
|
|
237
|
-
////////////////////////////////////////////////////////////
|
|
238
|
-
bool initialize(InputSoundFile& file);
|
|
239
|
-
|
|
240
|
-
////////////////////////////////////////////////////////////
|
|
241
|
-
/// \brief Update the internal buffer with the cached audio samples
|
|
242
|
-
///
|
|
243
|
-
/// \param channelCount Number of channels
|
|
244
|
-
/// \param sampleRate Sample rate (number of samples per second)
|
|
245
|
-
///
|
|
246
|
-
/// \return True on success, false if any error happened
|
|
247
|
-
///
|
|
248
|
-
////////////////////////////////////////////////////////////
|
|
249
|
-
bool update(unsigned int channelCount, unsigned int sampleRate);
|
|
250
|
-
|
|
251
|
-
////////////////////////////////////////////////////////////
|
|
252
|
-
/// \brief Add a sound to the list of sounds that use this buffer
|
|
253
|
-
///
|
|
254
|
-
/// \param sound Sound instance to attach
|
|
255
|
-
///
|
|
256
|
-
////////////////////////////////////////////////////////////
|
|
257
|
-
void attachSound(Sound* sound) const;
|
|
258
|
-
|
|
259
|
-
////////////////////////////////////////////////////////////
|
|
260
|
-
/// \brief Remove a sound from the list of sounds that use this buffer
|
|
261
|
-
///
|
|
262
|
-
/// \param sound Sound instance to detach
|
|
263
|
-
///
|
|
264
|
-
////////////////////////////////////////////////////////////
|
|
265
|
-
void detachSound(Sound* sound) const;
|
|
266
|
-
|
|
267
|
-
////////////////////////////////////////////////////////////
|
|
268
|
-
// Types
|
|
269
|
-
////////////////////////////////////////////////////////////
|
|
270
|
-
typedef std::set<Sound*> SoundList; ///< Set of unique sound instances
|
|
271
|
-
|
|
272
|
-
////////////////////////////////////////////////////////////
|
|
273
|
-
// Member data
|
|
274
|
-
////////////////////////////////////////////////////////////
|
|
275
|
-
unsigned int m_buffer; ///< OpenAL buffer identifier
|
|
276
|
-
std::vector<Int16> m_samples; ///< Samples buffer
|
|
277
|
-
Time m_duration; ///< Sound duration
|
|
278
|
-
mutable SoundList m_sounds; ///< List of sounds that are using this buffer
|
|
279
|
-
};
|
|
280
|
-
|
|
281
|
-
} // namespace sf
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
#endif // SFML_SOUNDBUFFER_HPP
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
////////////////////////////////////////////////////////////
|
|
288
|
-
/// \class sf::SoundBuffer
|
|
289
|
-
/// \ingroup audio
|
|
290
|
-
///
|
|
291
|
-
/// A sound buffer holds the data of a sound, which is
|
|
292
|
-
/// an array of audio samples. A sample is a 16 bits signed integer
|
|
293
|
-
/// that defines the amplitude of the sound at a given time.
|
|
294
|
-
/// The sound is then reconstituted by playing these samples at
|
|
295
|
-
/// a high rate (for example, 44100 samples per second is the
|
|
296
|
-
/// standard rate used for playing CDs). In short, audio samples
|
|
297
|
-
/// are like texture pixels, and a sf::SoundBuffer is similar to
|
|
298
|
-
/// a sf::Texture.
|
|
299
|
-
///
|
|
300
|
-
/// A sound buffer can be loaded from a file (see loadFromFile()
|
|
301
|
-
/// for the complete list of supported formats), from memory, from
|
|
302
|
-
/// a custom stream (see sf::InputStream) or directly from an array
|
|
303
|
-
/// of samples. It can also be saved back to a file.
|
|
304
|
-
///
|
|
305
|
-
/// Sound buffers alone are not very useful: they hold the audio data
|
|
306
|
-
/// but cannot be played. To do so, you need to use the sf::Sound class,
|
|
307
|
-
/// which provides functions to play/pause/stop the sound as well as
|
|
308
|
-
/// changing the way it is outputted (volume, pitch, 3D position, ...).
|
|
309
|
-
/// This separation allows more flexibility and better performances:
|
|
310
|
-
/// indeed a sf::SoundBuffer is a heavy resource, and any operation on it
|
|
311
|
-
/// is slow (often too slow for real-time applications). On the other
|
|
312
|
-
/// side, a sf::Sound is a lightweight object, which can use the audio data
|
|
313
|
-
/// of a sound buffer and change the way it is played without actually
|
|
314
|
-
/// modifying that data. Note that it is also possible to bind
|
|
315
|
-
/// several sf::Sound instances to the same sf::SoundBuffer.
|
|
316
|
-
///
|
|
317
|
-
/// It is important to note that the sf::Sound instance doesn't
|
|
318
|
-
/// copy the buffer that it uses, it only keeps a reference to it.
|
|
319
|
-
/// Thus, a sf::SoundBuffer must not be destructed while it is
|
|
320
|
-
/// used by a sf::Sound (i.e. never write a function that
|
|
321
|
-
/// uses a local sf::SoundBuffer instance for loading a sound).
|
|
322
|
-
///
|
|
323
|
-
/// Usage example:
|
|
324
|
-
/// \code
|
|
325
|
-
/// // Declare a new sound buffer
|
|
326
|
-
/// sf::SoundBuffer buffer;
|
|
327
|
-
///
|
|
328
|
-
/// // Load it from a file
|
|
329
|
-
/// if (!buffer.loadFromFile("sound.wav"))
|
|
330
|
-
/// {
|
|
331
|
-
/// // error...
|
|
332
|
-
/// }
|
|
333
|
-
///
|
|
334
|
-
/// // Create a sound source and bind it to the buffer
|
|
335
|
-
/// sf::Sound sound1;
|
|
336
|
-
/// sound1.setBuffer(buffer);
|
|
337
|
-
///
|
|
338
|
-
/// // Play the sound
|
|
339
|
-
/// sound1.play();
|
|
340
|
-
///
|
|
341
|
-
/// // Create another sound source bound to the same buffer
|
|
342
|
-
/// sf::Sound sound2;
|
|
343
|
-
/// sound2.setBuffer(buffer);
|
|
344
|
-
///
|
|
345
|
-
/// // Play it with a higher pitch -- the first sound remains unchanged
|
|
346
|
-
/// sound2.setPitch(2);
|
|
347
|
-
/// sound2.play();
|
|
348
|
-
/// \endcode
|
|
349
|
-
///
|
|
350
|
-
/// \see sf::Sound, sf::SoundBufferRecorder
|
|
351
|
-
///
|
|
352
|
-
////////////////////////////////////////////////////////////
|