sfml3-rb 0.2.1-x86-linux-gnu → 0.3.0-x86-linux-gnu
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.
- checksums.yaml +4 -4
- data/.yardopts +9 -0
- data/CHANGELOG.md +47 -0
- data/README.md +99 -24
- data/lib/sfml/3.1/sfml_ext.so +0 -0
- data/lib/sfml/3.2/sfml_ext.so +0 -0
- data/lib/sfml/3.3/sfml_ext.so +0 -0
- data/lib/sfml/3.4/sfml_ext.so +0 -0
- data/lib/sfml/4.0/sfml_ext.so +0 -0
- data/lib/sfml/version.rb +1 -1
- data/sig/audio/audio_enums.rbs +30 -0
- data/sig/audio/listener.rbs +16 -0
- data/sig/audio/music.rbs +56 -0
- data/sig/audio/sound.rbs +51 -0
- data/sig/audio/sound_buffer.rbs +17 -0
- data/sig/audio/sound_buffer_recorder.rbs +14 -0
- data/sig/audio/sound_recorder.rbs +17 -0
- data/sig/audio/sound_source_cone.rbs +14 -0
- data/sig/audio/sound_stream.rbs +51 -0
- data/sig/graphics/blend_mode.rbs +29 -0
- data/sig/graphics/circle.rbs +44 -0
- data/sig/graphics/color.rbs +39 -0
- data/sig/graphics/drawable.rbs +5 -0
- data/sig/graphics/font.rbs +20 -0
- data/sig/graphics/glyph.rbs +7 -0
- data/sig/graphics/image.rbs +22 -0
- data/sig/graphics/polygon.rbs +42 -0
- data/sig/graphics/rect.rbs +33 -0
- data/sig/graphics/rectangle.rbs +42 -0
- data/sig/graphics/render_state.rbs +21 -0
- data/sig/graphics/render_texture.rbs +37 -0
- data/sig/graphics/shader.rbs +39 -0
- data/sig/graphics/shape.rbs +38 -0
- data/sig/graphics/sprite.rbs +34 -0
- data/sig/graphics/stencil_mode.rbs +18 -0
- data/sig/graphics/target.rbs +10 -0
- data/sig/graphics/text.rbs +48 -0
- data/sig/graphics/texture.rbs +34 -0
- data/sig/graphics/transform.rbs +37 -0
- data/sig/graphics/transformable.rbs +25 -0
- data/sig/graphics/vertex.rbs +17 -0
- data/sig/graphics/vertex_array.rbs +17 -0
- data/sig/graphics/vertex_buffer.rbs +22 -0
- data/sig/graphics/view.rbs +24 -0
- data/sig/network/ftp.rbs +46 -0
- data/sig/network/http.rbs +27 -0
- data/sig/network/ip_address.rbs +22 -0
- data/sig/network/network_enums.rbs +95 -0
- data/sig/network/packet.rbs +40 -0
- data/sig/network/socket_selector.rbs +14 -0
- data/sig/network/tcp_listener.rbs +13 -0
- data/sig/network/tcp_socket.rbs +18 -0
- data/sig/network/udp_socket.rbs +17 -0
- data/sig/system/buffer.rbs +11 -0
- data/sig/system/clock.rbs +13 -0
- data/sig/system/input_stream.rbs +7 -0
- data/sig/system/sleep.rbs +3 -0
- data/sig/system/time.rbs +28 -0
- data/sig/system/vec2.rbs +26 -0
- data/sig/system/vec3.rbs +27 -0
- data/sig/window/clipboard.rbs +8 -0
- data/sig/window/context.rbs +11 -0
- data/sig/window/context_settings.rbs +20 -0
- data/sig/window/cursor.rbs +6 -0
- data/sig/window/event.rbs +20 -0
- data/sig/window/joystick.rbs +15 -0
- data/sig/window/keyboard.rbs +10 -0
- data/sig/window/mouse.rbs +9 -0
- data/sig/window/sensor.rbs +8 -0
- data/sig/window/touch.rbs +6 -0
- data/sig/window/video_mode.rbs +16 -0
- data/sig/window/vulkan.rbs +7 -0
- data/sig/window/window.rbs +57 -0
- metadata +65 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 519b659696edf580859c4b1d648d67befe964cda1b2e2fcabff9695a0d84024f
|
|
4
|
+
data.tar.gz: 2af12270fff878dbeda6c6dae4a5c9ea1c73d0b6f3e2d24815d1ce5d528d5a28
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fd11b7c1a2da069e4f8da9fa79ad2623f126f19bd970420f98561127a9e785c63f6acff50aabc94a5c6d75766fe95927031d4cf7907f1141941690f5c548488f
|
|
7
|
+
data.tar.gz: 200a5fbcec6896e072cf437ce7c2f53473915eaa3eccfc6416affa79e49d4b75efe73b54ac9dc69f1ab0a670cabade4bc1d6c06ddc6e359d5bcc0c8b123efa02
|
data/.yardopts
ADDED
data/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,53 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.3.0] - 2026-09-19
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
* **Four more experimental binary-gem targets**: `aarch64-linux-musl`, `arm-linux-gnu`
|
|
13
|
+
(ARMv7 hard-float), `arm-linux-musl`, and `aarch64-mingw-ucrt` (64-bit Windows on ARM).
|
|
14
|
+
All four ride the same rake-compiler-dock cross-compilation this project already uses for
|
|
15
|
+
its other targets; none has been run on its target hardware yet, so all are
|
|
16
|
+
`experimental` in `publish.yaml` like `aarch64-linux-gnu`, `x86_64-darwin` and
|
|
17
|
+
`arm64-darwin` already were. `script/provision.sh` gained matching cases for the two new
|
|
18
|
+
glibc/musl Linux targets.
|
|
19
|
+
* `rakelib/package.rake`'s `EXPECTED_ABIS` gained an entry for `aarch64-mingw-ucrt`: its
|
|
20
|
+
rake-compiler-dock image carries no cross Ruby older than 3.4, so that gem has no floor
|
|
21
|
+
below it — the same kind of upstream gap `x86-mingw32` already has at the top end.
|
|
22
|
+
* `aarch64-linux-gnu` is now additionally run — not just cross-compiled — by a new
|
|
23
|
+
`test-arm64.yaml` workflow, on GitHub's hosted `ubuntu-24.04-arm` runner. It stays
|
|
24
|
+
`experimental` in `publish.yaml` for now; this is the evidence that will eventually
|
|
25
|
+
justify dropping that flag.
|
|
26
|
+
* ARMv6 (32-bit), RISC-V (rv64gc), PowerPC (ppc64le), and any BSD are deliberately not
|
|
27
|
+
covered by a binary gem: rake-compiler-dock ships no cross-compilation image for any of
|
|
28
|
+
them, and building custom cross-toolchain infrastructure for them is a much larger,
|
|
29
|
+
separate undertaking. The source-gem fallback remains the only path there, unchanged.
|
|
30
|
+
|
|
31
|
+
### Fixed
|
|
32
|
+
* **A GC race in the audio bindings aborted the process on arm64.** `Sound`, `Music` and
|
|
33
|
+
`SoundStream` released the GVL inside their `dfree`, but their data types were marked
|
|
34
|
+
`RUBY_TYPED_FREE_IMMEDIATELY`, so the free could run *during* garbage collection: another
|
|
35
|
+
thread (Ruby's `Timeout` thread, in the test suite) could then allocate while GC was mid-cycle
|
|
36
|
+
and Ruby aborted with "object allocation during garbage collection phase". Dropping the flag
|
|
37
|
+
defers the free to a safe point; releasing the GVL is still what keeps `sf*_destroy` from
|
|
38
|
+
deadlocking against the audio thread.
|
|
39
|
+
|
|
40
|
+
### Documentation
|
|
41
|
+
* **Every public class, module, method and constant is documented**, with the
|
|
42
|
+
result rendered on [rubydoc.info](https://rubydoc.info/gems/sfml3-rb). The
|
|
43
|
+
comments live beside each binding in `ext/**/*.c`; `rake yard` builds them
|
|
44
|
+
into `doc/`. Previously the comments carried `call-seq` and `@return` tags
|
|
45
|
+
but little prose, so rubydoc.info showed a signature with a blank
|
|
46
|
+
description; every such method now has a sentence of its own.
|
|
47
|
+
* RBS type signatures for the same surface ship in `sig/**/*.rbs`, for IDE
|
|
48
|
+
completion (Solargraph, RubyMine) and static checking (Sorbet, Steep);
|
|
49
|
+
`rake rbs` validates them.
|
|
50
|
+
* `.yardopts` ships in the gem, so rubydoc.info generates with the same title,
|
|
51
|
+
README and extra files as `rake yard`.
|
|
52
|
+
* `rake doc:undoc` fails when a method is left without a description, so the
|
|
53
|
+
coverage cannot regress silently (`yard stats` uses `blank?` and passes for
|
|
54
|
+
tag-only comments, which is how the blanks went unnoticed).
|
|
55
|
+
|
|
9
56
|
## [0.2.1]
|
|
10
57
|
|
|
11
58
|
### Added
|
data/README.md
CHANGED
|
@@ -2,12 +2,40 @@
|
|
|
2
2
|
|
|
3
3
|
Ruby bindings for [SFML 3](https://www.sfml-dev.org/), via its C API, [CSFML](https://github.com/SFML/CSFML).
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
[](https://www.ruby-lang.org/)
|
|
6
|
+
[](https://github.com/algaves/sfml3.rb/actions/workflows/test.yaml)
|
|
7
|
+
[](https://github.com/algaves/sfml3.rb/actions/workflows/check.yaml)
|
|
8
|
+
[](https://rubygems.org/gems/sfml3-rb)
|
|
9
|
+
[](https://rubygems.org/gems/sfml3-rb)
|
|
10
|
+
[](LICENSE.md)
|
|
11
|
+
|
|
12
|
+
Latest release: **0.3.0**, bound against **CSFML 3**.
|
|
13
|
+
|
|
14
|
+
## Features
|
|
15
|
+
|
|
16
|
+
* **Broad coverage of SFML 3**, bound through CSFML: windows and events, graphics, audio, network,
|
|
17
|
+
and the system layer, with every `sf*` entry point tracked in [TODO.md](TODO.md).
|
|
18
|
+
* **Precompiled binary gems** for common platforms, with FreeType, SFML 3 and CSFML 3 statically
|
|
19
|
+
linked in — no toolchain and nothing to install system-wide.
|
|
20
|
+
* **A source fallback everywhere else**, which downloads and builds the pinned, checksum-verified
|
|
21
|
+
dependencies at install time, so the gem works on macOS, ARM and the BSDs out of the box.
|
|
22
|
+
* **Complete API documentation and types**: every class, module, method and constant is documented
|
|
23
|
+
on [rubydoc.info](https://rubydoc.info/gems/sfml3-rb) and covered by RBS signatures shipped in
|
|
24
|
+
the gem.
|
|
25
|
+
* **A close fit to SFML's own model**: classes mirror the C++ types (Window, Texture, Sprite,
|
|
26
|
+
Sound, ...) minus the parts that only exist in C++, like `std::string` and exceptions.
|
|
27
|
+
|
|
28
|
+
## Table of Contents
|
|
29
|
+
|
|
30
|
+
* [Installation](#installation)
|
|
31
|
+
* [Quick Start](#quick-start)
|
|
32
|
+
* [Documentation](#documentation)
|
|
33
|
+
* [Development](#development)
|
|
34
|
+
* [Contributing](#contributing)
|
|
35
|
+
* [Acknowledgements](#acknowledgements)
|
|
36
|
+
* [License](#license)
|
|
37
|
+
|
|
38
|
+
## Installation
|
|
11
39
|
|
|
12
40
|
```sh
|
|
13
41
|
gem install sfml3-rb
|
|
@@ -24,11 +52,18 @@ already linked in — no toolchain, no build, nothing to install system-wide:
|
|
|
24
52
|
| `x86-linux-musl` | 3.1 – 4.0 | 32-bit musl |
|
|
25
53
|
| `x64-mingw-ucrt` | 3.1 – 4.0 | 64-bit Windows, RubyInstaller 3.1+ |
|
|
26
54
|
| `x86-mingw32` | 3.1 – **3.4** | 32-bit Windows |
|
|
27
|
-
| `aarch64-linux-gnu
|
|
55
|
+
| `aarch64-linux-gnu` | 3.1 – 4.0 | experimental, cross-built and run on a native arm64 CI runner |
|
|
56
|
+
| `aarch64-linux-musl`, `arm-linux-gnu`, `arm-linux-musl` | 3.1 – 4.0 | experimental, not yet built |
|
|
57
|
+
| `aarch64-mingw-ucrt` | 3.4 – **4.0** | experimental, 64-bit Windows on ARM |
|
|
58
|
+
| `x86_64-darwin`, `arm64-darwin` | 3.1 – 4.0 | experimental, not yet built |
|
|
59
|
+
|
|
60
|
+
Each gem carries one extension per Ruby ABI. Three gaps come from upstream rather than from this
|
|
61
|
+
project: **RubyInstaller publishes no 32-bit Ruby 4.0**, so `x86-mingw32` stops at 3.4; 64-bit
|
|
62
|
+
Windows before Ruby 3.1 used a different platform (`x64-mingw32`), which is not built; and the
|
|
63
|
+
cross-compilation image for `aarch64-mingw-ucrt` carries no cross Ruby older than 3.4, so that
|
|
64
|
+
gem has no floor below it.
|
|
28
65
|
|
|
29
|
-
|
|
30
|
-
project: **RubyInstaller publishes no 32-bit Ruby 4.0**, so `x86-mingw32` stops at 3.4; and 64-bit
|
|
31
|
-
Windows before Ruby 3.1 used a different platform (`x64-mingw32`), which is not built.
|
|
66
|
+
### Building from source
|
|
32
67
|
|
|
33
68
|
Anywhere else — macOS, ARM, the BSDs — RubyGems falls back to the source gem, which downloads and
|
|
34
69
|
builds FreeType, SFML 3 and CSFML 3 from pinned, checksum-verified tarballs at install time. That
|
|
@@ -37,36 +72,39 @@ takes a few minutes and needs:
|
|
|
37
72
|
* Ruby >= 3.1
|
|
38
73
|
* A C/C++ toolchain and CMake >= 3.22
|
|
39
74
|
* On Linux, the X11/udev/OpenGL development headers SFML links against — these can't be bundled.
|
|
40
|
-
On Fedora:
|
|
41
75
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
76
|
+
On Fedora:
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
sudo dnf install cmake gcc-c++ libX11-devel \
|
|
80
|
+
libXrandr-devel libXcursor-devel libXi-devel systemd-devel libglvnd-devel
|
|
81
|
+
```
|
|
46
82
|
|
|
47
|
-
|
|
83
|
+
On Debian/Ubuntu:
|
|
48
84
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
85
|
+
```sh
|
|
86
|
+
sudo apt-get install cmake build-essential libx11-dev \
|
|
87
|
+
libxrandr-dev libxcursor-dev libxi-dev libudev-dev libgl1-mesa-dev
|
|
88
|
+
```
|
|
53
89
|
|
|
54
90
|
Each installed gem version builds its own copy; there's no build cache shared across versions.
|
|
55
91
|
|
|
92
|
+
### Linking against system libraries
|
|
93
|
+
|
|
56
94
|
To link against a system CSFML 3 instead (no download, no build):
|
|
57
95
|
|
|
58
96
|
```sh
|
|
59
97
|
gem install sfml3-rb -- --enable-system-libraries
|
|
60
98
|
```
|
|
61
99
|
|
|
62
|
-
##
|
|
100
|
+
## Quick Start
|
|
63
101
|
|
|
64
102
|
```ruby
|
|
65
103
|
require 'sfml'
|
|
66
104
|
include SFML
|
|
67
105
|
|
|
68
106
|
window = Window.new VideoMode.new(640, 480, 32), 'SFML'
|
|
69
|
-
event
|
|
107
|
+
event = Event.new
|
|
70
108
|
|
|
71
109
|
while window.is_open?
|
|
72
110
|
while window.poll_event! event
|
|
@@ -78,7 +116,20 @@ while window.is_open?
|
|
|
78
116
|
end
|
|
79
117
|
```
|
|
80
118
|
|
|
81
|
-
|
|
119
|
+
Event types are strings (`'closed'`, `'resized'`, `'key-pressed'`, ...); keys and buttons are enums.
|
|
120
|
+
|
|
121
|
+
See [`test/hello-world.rb`](test/hello-world.rb) for a fuller example with shapes and transforms,
|
|
122
|
+
and [`test/matrix-transformable.rb`](test/matrix-transformable.rb) for a visual demo. Neither is
|
|
123
|
+
part of the test suite.
|
|
124
|
+
|
|
125
|
+
## Documentation
|
|
126
|
+
|
|
127
|
+
* [API reference](https://rubydoc.info/gems/sfml3-rb) — every class, module, method and constant,
|
|
128
|
+
built from the YARD comments in `ext/**/*.c`.
|
|
129
|
+
* RBS type signatures (`sig/**/*.rbs`) ship in the gem for IDE completion (Solargraph, RubyMine)
|
|
130
|
+
and static type-checking (Sorbet, Steep). Validate them with `rake rbs`.
|
|
131
|
+
* [CHANGELOG.md](CHANGELOG.md) — what changed in each release.
|
|
132
|
+
* [TODO.md](TODO.md) — module-by-module porting coverage and what is deliberately unbound.
|
|
82
133
|
|
|
83
134
|
## Development
|
|
84
135
|
|
|
@@ -87,6 +138,8 @@ rake ports # build the vendored FreeType + SFML 3 + CSFML 3 (rake compile doe
|
|
|
87
138
|
rake compile # build the C extension into lib/sfml/
|
|
88
139
|
rake test # compile, then run the test suite
|
|
89
140
|
rake gem # build the source gem into pkg/
|
|
141
|
+
rake yard # build API docs into doc/
|
|
142
|
+
rake rbs # validate sig/**/*.rbs
|
|
90
143
|
```
|
|
91
144
|
|
|
92
145
|
`rake githooks:install` points your checkout at the committed `.githooks/` pre-commit hook, which
|
|
@@ -131,9 +184,31 @@ mingw toolchain and the osxcross SDK already provide.
|
|
|
131
184
|
Binary gems carry one extension per Ruby ABI under `lib/sfml/<major.minor>/`; `lib/sfml.rb` prefers
|
|
132
185
|
that and falls back to the single `lib/sfml/sfml_ext.so` a source build installs.
|
|
133
186
|
|
|
187
|
+
## Contributing
|
|
188
|
+
|
|
189
|
+
Bug reports and pull requests are welcome on
|
|
190
|
+
[GitHub](https://github.com/algaves/sfml3.rb/issues). Before opening a pull request:
|
|
191
|
+
|
|
192
|
+
```sh
|
|
193
|
+
bundle install
|
|
194
|
+
bundle exec rake test # build the extension and run the suite
|
|
195
|
+
bundle exec rubocop # lint Ruby (CI enforces this)
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Install the pre-commit hook with `bundle exec rake githooks:install` so staged Ruby is linted and
|
|
199
|
+
staged C is formatted automatically. The C build is warning-clean under `SFML_STRICT=1`; keep it
|
|
200
|
+
that way.
|
|
201
|
+
|
|
202
|
+
## Acknowledgements
|
|
203
|
+
|
|
204
|
+
This gem would not exist without [SFML](https://www.sfml-dev.org/) and its C binding,
|
|
205
|
+
[CSFML](https://github.com/SFML/CSFML), both maintained by the SFML team. The source build also
|
|
206
|
+
vendors and links FreeType, Ogg, Vorbis and FLAC; see [`ext/ports.rb`](ext/ports.rb) and the
|
|
207
|
+
[LICENSE](LICENSE.md) for their terms.
|
|
208
|
+
|
|
134
209
|
## License
|
|
135
210
|
|
|
136
|
-
[
|
|
211
|
+
This project is licensed under the BSD Zero Clause License (0BSD) - see the [LICENSE](LICENSE.md) file for details.
|
|
137
212
|
|
|
138
213
|
---
|
|
139
214
|
|
data/lib/sfml/3.1/sfml_ext.so
CHANGED
|
Binary file
|
data/lib/sfml/3.2/sfml_ext.so
CHANGED
|
Binary file
|
data/lib/sfml/3.3/sfml_ext.so
CHANGED
|
Binary file
|
data/lib/sfml/3.4/sfml_ext.so
CHANGED
|
Binary file
|
data/lib/sfml/4.0/sfml_ext.so
CHANGED
|
Binary file
|
data/lib/sfml/version.rb
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
module SoundStatus
|
|
3
|
+
STOPPED: Integer
|
|
4
|
+
PAUSED: Integer
|
|
5
|
+
PLAYING: Integer
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
module SoundChannel
|
|
9
|
+
UNSPECIFIED: Integer
|
|
10
|
+
MONO: Integer
|
|
11
|
+
FRONT_LEFT: Integer
|
|
12
|
+
FRONT_RIGHT: Integer
|
|
13
|
+
FRONT_CENTER: Integer
|
|
14
|
+
FRONT_LEFT_OF_CENTER: Integer
|
|
15
|
+
FRONT_RIGHT_OF_CENTER: Integer
|
|
16
|
+
LOW_FREQUENCY_EFFECTS: Integer
|
|
17
|
+
BACK_LEFT: Integer
|
|
18
|
+
BACK_RIGHT: Integer
|
|
19
|
+
BACK_CENTER: Integer
|
|
20
|
+
SIDE_LEFT: Integer
|
|
21
|
+
SIDE_RIGHT: Integer
|
|
22
|
+
TOP_CENTER: Integer
|
|
23
|
+
TOP_FRONT_LEFT: Integer
|
|
24
|
+
TOP_FRONT_RIGHT: Integer
|
|
25
|
+
TOP_FRONT_CENTER: Integer
|
|
26
|
+
TOP_BACK_LEFT: Integer
|
|
27
|
+
TOP_BACK_RIGHT: Integer
|
|
28
|
+
TOP_BACK_CENTER: Integer
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
module Listener
|
|
3
|
+
def self.global_volume: () -> Float
|
|
4
|
+
def self.global_volume=: (Float value) -> Float
|
|
5
|
+
def self.position: () -> Vector3
|
|
6
|
+
def self.position=: (Vector3 value) -> Vector3
|
|
7
|
+
def self.direction: () -> Vector3
|
|
8
|
+
def self.direction=: (Vector3 value) -> Vector3
|
|
9
|
+
def self.velocity: () -> Vector3
|
|
10
|
+
def self.velocity=: (Vector3 value) -> Vector3
|
|
11
|
+
def self.up_vector: () -> Vector3
|
|
12
|
+
def self.up_vector=: (Vector3 value) -> Vector3
|
|
13
|
+
def self.cone: () -> SoundSourceCone
|
|
14
|
+
def self.cone=: (SoundSourceCone value) -> SoundSourceCone
|
|
15
|
+
end
|
|
16
|
+
end
|
data/sig/audio/music.rbs
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class Music
|
|
3
|
+
def self.from_file: (String path) -> Music
|
|
4
|
+
def self.from_memory: (String data) -> Music
|
|
5
|
+
def self.from_stream: (untyped stream) -> Music
|
|
6
|
+
|
|
7
|
+
def duration: () -> Time
|
|
8
|
+
def channel_count: () -> Integer
|
|
9
|
+
def sample_rate: () -> Integer
|
|
10
|
+
def channel_map: () -> Array[Symbol]
|
|
11
|
+
def loop_points: () -> [Time, Time]
|
|
12
|
+
def loop_points=: ([Time, Time] value) -> [Time, Time]
|
|
13
|
+
|
|
14
|
+
def play: () -> self
|
|
15
|
+
def pause: () -> self
|
|
16
|
+
def stop: () -> self
|
|
17
|
+
def status: () -> (:stopped | :paused | :playing)
|
|
18
|
+
def looping?: () -> bool
|
|
19
|
+
def looping=: (bool value) -> bool
|
|
20
|
+
def pitch: () -> Float
|
|
21
|
+
def pitch=: (Float value) -> Float
|
|
22
|
+
def pan: () -> Float
|
|
23
|
+
def pan=: (Float value) -> Float
|
|
24
|
+
def volume: () -> Float
|
|
25
|
+
def volume=: (Float value) -> Float
|
|
26
|
+
def spatialization_enabled?: () -> bool
|
|
27
|
+
def spatialization_enabled=: (bool value) -> bool
|
|
28
|
+
def position: () -> Vector3
|
|
29
|
+
def position=: (Vector3 value) -> Vector3
|
|
30
|
+
def direction: () -> Vector3
|
|
31
|
+
def direction=: (Vector3 value) -> Vector3
|
|
32
|
+
def velocity: () -> Vector3
|
|
33
|
+
def velocity=: (Vector3 value) -> Vector3
|
|
34
|
+
def cone: () -> SoundSourceCone
|
|
35
|
+
def cone=: (SoundSourceCone value) -> SoundSourceCone
|
|
36
|
+
def doppler_factor: () -> Float
|
|
37
|
+
def doppler_factor=: (Float value) -> Float
|
|
38
|
+
def directional_attenuation_factor: () -> Float
|
|
39
|
+
def directional_attenuation_factor=: (Float value) -> Float
|
|
40
|
+
def relative_to_listener?: () -> bool
|
|
41
|
+
def relative_to_listener=: (bool value) -> bool
|
|
42
|
+
def min_distance: () -> Float
|
|
43
|
+
def min_distance=: (Float value) -> Float
|
|
44
|
+
def max_distance: () -> Float
|
|
45
|
+
def max_distance=: (Float value) -> Float
|
|
46
|
+
def min_gain: () -> Float
|
|
47
|
+
def min_gain=: (Float value) -> Float
|
|
48
|
+
def max_gain: () -> Float
|
|
49
|
+
def max_gain=: (Float value) -> Float
|
|
50
|
+
def attenuation: () -> Float
|
|
51
|
+
def attenuation=: (Float value) -> Float
|
|
52
|
+
def playing_offset: () -> Time
|
|
53
|
+
def playing_offset=: (Time value) -> Time
|
|
54
|
+
def effect_processor=: (Proc proc) -> Proc
|
|
55
|
+
end
|
|
56
|
+
end
|
data/sig/audio/sound.rbs
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class Sound
|
|
3
|
+
def self.new: (SoundBuffer buffer) -> Sound
|
|
4
|
+
|
|
5
|
+
def copy: () -> Sound
|
|
6
|
+
def buffer: () -> SoundBuffer
|
|
7
|
+
def buffer=: (SoundBuffer value) -> SoundBuffer
|
|
8
|
+
|
|
9
|
+
def play: () -> self
|
|
10
|
+
def pause: () -> self
|
|
11
|
+
def stop: () -> self
|
|
12
|
+
def status: () -> (:stopped | :paused | :playing)
|
|
13
|
+
def looping?: () -> bool
|
|
14
|
+
def looping=: (bool value) -> bool
|
|
15
|
+
def pitch: () -> Float
|
|
16
|
+
def pitch=: (Float value) -> Float
|
|
17
|
+
def pan: () -> Float
|
|
18
|
+
def pan=: (Float value) -> Float
|
|
19
|
+
def volume: () -> Float
|
|
20
|
+
def volume=: (Float value) -> Float
|
|
21
|
+
def spatialization_enabled?: () -> bool
|
|
22
|
+
def spatialization_enabled=: (bool value) -> bool
|
|
23
|
+
def position: () -> Vector3
|
|
24
|
+
def position=: (Vector3 value) -> Vector3
|
|
25
|
+
def direction: () -> Vector3
|
|
26
|
+
def direction=: (Vector3 value) -> Vector3
|
|
27
|
+
def velocity: () -> Vector3
|
|
28
|
+
def velocity=: (Vector3 value) -> Vector3
|
|
29
|
+
def cone: () -> SoundSourceCone
|
|
30
|
+
def cone=: (SoundSourceCone value) -> SoundSourceCone
|
|
31
|
+
def doppler_factor: () -> Float
|
|
32
|
+
def doppler_factor=: (Float value) -> Float
|
|
33
|
+
def directional_attenuation_factor: () -> Float
|
|
34
|
+
def directional_attenuation_factor=: (Float value) -> Float
|
|
35
|
+
def relative_to_listener?: () -> bool
|
|
36
|
+
def relative_to_listener=: (bool value) -> bool
|
|
37
|
+
def min_distance: () -> Float
|
|
38
|
+
def min_distance=: (Float value) -> Float
|
|
39
|
+
def max_distance: () -> Float
|
|
40
|
+
def max_distance=: (Float value) -> Float
|
|
41
|
+
def min_gain: () -> Float
|
|
42
|
+
def min_gain=: (Float value) -> Float
|
|
43
|
+
def max_gain: () -> Float
|
|
44
|
+
def max_gain=: (Float value) -> Float
|
|
45
|
+
def attenuation: () -> Float
|
|
46
|
+
def attenuation=: (Float value) -> Float
|
|
47
|
+
def playing_offset: () -> Time
|
|
48
|
+
def playing_offset=: (Time value) -> Time
|
|
49
|
+
def effect_processor=: (Proc proc) -> Proc
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class SoundBuffer
|
|
3
|
+
def self.from_file: (String path) -> SoundBuffer
|
|
4
|
+
def self.from_memory: (String data) -> SoundBuffer
|
|
5
|
+
def self.from_stream: (untyped stream) -> SoundBuffer
|
|
6
|
+
def self.from_samples: (Array[Integer] | String samples, Integer channel_count, Integer sample_rate, ?Array[Symbol] channel_map) -> SoundBuffer
|
|
7
|
+
|
|
8
|
+
def copy: () -> SoundBuffer
|
|
9
|
+
def save_to_file: (String path) -> bool
|
|
10
|
+
def samples: () -> Array[Integer]
|
|
11
|
+
def sample_count: () -> Integer
|
|
12
|
+
def sample_rate: () -> Integer
|
|
13
|
+
def channel_count: () -> Integer
|
|
14
|
+
def channel_map: () -> Array[Symbol]
|
|
15
|
+
def duration: () -> Time
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class SoundBufferRecorder
|
|
3
|
+
def self.new: () -> SoundBufferRecorder
|
|
4
|
+
|
|
5
|
+
def start: (Integer sample_rate) -> bool
|
|
6
|
+
def stop: () -> self
|
|
7
|
+
def sample_rate: () -> Integer
|
|
8
|
+
def buffer: () -> SoundBuffer
|
|
9
|
+
def device: () -> String
|
|
10
|
+
def device=: (String value) -> bool
|
|
11
|
+
def channel_count: () -> Integer
|
|
12
|
+
def channel_count=: (Integer value) -> Integer
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class SoundRecorder
|
|
3
|
+
def self.new: () -> SoundRecorder
|
|
4
|
+
def self.available?: () -> bool
|
|
5
|
+
def self.available_devices: () -> Array[String]
|
|
6
|
+
def self.default_device: () -> String?
|
|
7
|
+
|
|
8
|
+
def start: (Integer sample_rate) -> bool
|
|
9
|
+
def stop: () -> self
|
|
10
|
+
def sample_rate: () -> Integer
|
|
11
|
+
def device: () -> String?
|
|
12
|
+
def device=: (String value) -> bool
|
|
13
|
+
def channel_count: () -> Integer
|
|
14
|
+
def channel_count=: (Integer value) -> Integer
|
|
15
|
+
def channel_map: () -> Array[Symbol]
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class SoundSourceCone
|
|
3
|
+
def self.new: (Float inner_angle, Float outer_angle, Float outer_gain) -> SoundSourceCone
|
|
4
|
+
|
|
5
|
+
def inner_angle: () -> Float
|
|
6
|
+
def inner_angle=: (Float value) -> Float
|
|
7
|
+
def outer_angle: () -> Float
|
|
8
|
+
def outer_angle=: (Float value) -> Float
|
|
9
|
+
def outer_gain: () -> Float
|
|
10
|
+
def outer_gain=: (Float value) -> Float
|
|
11
|
+
def to_a: () -> [Float, Float, Float]
|
|
12
|
+
def ==: (untyped other) -> bool
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class SoundStream
|
|
3
|
+
def self.new: (Integer channel_count, Integer sample_rate, ?Array[Symbol] channel_map) -> SoundStream
|
|
4
|
+
|
|
5
|
+
def channel_count: () -> Integer
|
|
6
|
+
def sample_rate: () -> Integer
|
|
7
|
+
def channel_map: () -> Array[Symbol]
|
|
8
|
+
|
|
9
|
+
def play: () -> self
|
|
10
|
+
def pause: () -> self
|
|
11
|
+
def stop: () -> self
|
|
12
|
+
def status: () -> (:stopped | :paused | :playing)
|
|
13
|
+
def looping?: () -> bool
|
|
14
|
+
def looping=: (bool value) -> bool
|
|
15
|
+
def pitch: () -> Float
|
|
16
|
+
def pitch=: (Float value) -> Float
|
|
17
|
+
def pan: () -> Float
|
|
18
|
+
def pan=: (Float value) -> Float
|
|
19
|
+
def volume: () -> Float
|
|
20
|
+
def volume=: (Float value) -> Float
|
|
21
|
+
def spatialization_enabled?: () -> bool
|
|
22
|
+
def spatialization_enabled=: (bool value) -> bool
|
|
23
|
+
def position: () -> Vector3
|
|
24
|
+
def position=: (Vector3 value) -> Vector3
|
|
25
|
+
def direction: () -> Vector3
|
|
26
|
+
def direction=: (Vector3 value) -> Vector3
|
|
27
|
+
def velocity: () -> Vector3
|
|
28
|
+
def velocity=: (Vector3 value) -> Vector3
|
|
29
|
+
def cone: () -> SoundSourceCone
|
|
30
|
+
def cone=: (SoundSourceCone value) -> SoundSourceCone
|
|
31
|
+
def doppler_factor: () -> Float
|
|
32
|
+
def doppler_factor=: (Float value) -> Float
|
|
33
|
+
def directional_attenuation_factor: () -> Float
|
|
34
|
+
def directional_attenuation_factor=: (Float value) -> Float
|
|
35
|
+
def relative_to_listener?: () -> bool
|
|
36
|
+
def relative_to_listener=: (bool value) -> bool
|
|
37
|
+
def min_distance: () -> Float
|
|
38
|
+
def min_distance=: (Float value) -> Float
|
|
39
|
+
def max_distance: () -> Float
|
|
40
|
+
def max_distance=: (Float value) -> Float
|
|
41
|
+
def min_gain: () -> Float
|
|
42
|
+
def min_gain=: (Float value) -> Float
|
|
43
|
+
def max_gain: () -> Float
|
|
44
|
+
def max_gain=: (Float value) -> Float
|
|
45
|
+
def attenuation: () -> Float
|
|
46
|
+
def attenuation=: (Float value) -> Float
|
|
47
|
+
def playing_offset: () -> Time
|
|
48
|
+
def playing_offset=: (Time value) -> Time
|
|
49
|
+
def effect_processor=: (Proc proc) -> Proc
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class BlendMode
|
|
3
|
+
def self.new: () -> BlendMode
|
|
4
|
+
| (Symbol | Integer color_src_factor, Symbol | Integer color_dst_factor,
|
|
5
|
+
Symbol | Integer color_equation, Symbol | Integer alpha_src_factor,
|
|
6
|
+
Symbol | Integer alpha_dst_factor, Symbol | Integer alpha_equation) -> BlendMode
|
|
7
|
+
|
|
8
|
+
def color_src_factor: () -> Symbol
|
|
9
|
+
def color_src_factor=: (Symbol | Integer value) -> Symbol
|
|
10
|
+
def color_dst_factor: () -> Symbol
|
|
11
|
+
def color_dst_factor=: (Symbol | Integer value) -> Symbol
|
|
12
|
+
def color_equation: () -> Symbol
|
|
13
|
+
def color_equation=: (Symbol | Integer value) -> Symbol
|
|
14
|
+
def alpha_src_factor: () -> Symbol
|
|
15
|
+
def alpha_src_factor=: (Symbol | Integer value) -> Symbol
|
|
16
|
+
def alpha_dst_factor: () -> Symbol
|
|
17
|
+
def alpha_dst_factor=: (Symbol | Integer value) -> Symbol
|
|
18
|
+
def alpha_equation: () -> Symbol
|
|
19
|
+
def alpha_equation=: (Symbol | Integer value) -> Symbol
|
|
20
|
+
def ==: (untyped other) -> bool
|
|
21
|
+
|
|
22
|
+
NONE: BlendMode
|
|
23
|
+
ALPHA: BlendMode
|
|
24
|
+
ADD: BlendMode
|
|
25
|
+
MULTIPLY: BlendMode
|
|
26
|
+
MIN: BlendMode
|
|
27
|
+
MAX: BlendMode
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class Circle
|
|
3
|
+
include Drawable
|
|
4
|
+
|
|
5
|
+
def self.new: (?Float radius) -> Circle
|
|
6
|
+
|
|
7
|
+
def copy: () -> Circle
|
|
8
|
+
def move: (Vector2 | Array[Float] offset) -> self
|
|
9
|
+
def rotate: (Float angle) -> self
|
|
10
|
+
def scale!: (Vector2 | Array[Float] factors) -> self
|
|
11
|
+
def draw: (untyped target, RenderState state) -> nil
|
|
12
|
+
|
|
13
|
+
def radius=: (Float value) -> Float
|
|
14
|
+
def position=: (Vector2 | Array[Float] value) -> Vector2
|
|
15
|
+
def rotation=: (Float value) -> Float
|
|
16
|
+
def scale=: (Vector2 | Array[Float] value) -> Vector2
|
|
17
|
+
def origin=: (Vector2 | Array[Float] value) -> Vector2
|
|
18
|
+
def fill_color=: (Color value) -> Color
|
|
19
|
+
def outline_color=: (Color value) -> Color
|
|
20
|
+
def outline_thickness=: (Float value) -> Float
|
|
21
|
+
def texture=: (Texture? value) -> Texture?
|
|
22
|
+
def texture_rect=: (Rect value) -> Rect
|
|
23
|
+
def point_count=: (Integer value) -> self
|
|
24
|
+
|
|
25
|
+
def radius: () -> Float
|
|
26
|
+
def position: () -> Vector2
|
|
27
|
+
def rotation: () -> Float
|
|
28
|
+
def scale: () -> Vector2
|
|
29
|
+
def origin: () -> Vector2
|
|
30
|
+
def fill_color: () -> Color
|
|
31
|
+
def outline_color: () -> Color
|
|
32
|
+
def outline_thickness: () -> Float
|
|
33
|
+
def texture: () -> (Texture | nil)
|
|
34
|
+
def texture_rect: () -> Rect
|
|
35
|
+
def point_count: () -> Integer
|
|
36
|
+
def point: (Integer index) -> Vector2
|
|
37
|
+
def geometric_center: () -> Vector2
|
|
38
|
+
def local_bounds: () -> Rect
|
|
39
|
+
def global_bounds: () -> Rect
|
|
40
|
+
def transform: () -> Array[untyped]
|
|
41
|
+
def inverse_transform: () -> Array[untyped]
|
|
42
|
+
def matrix: () -> Array[untyped]
|
|
43
|
+
end
|
|
44
|
+
end
|