sfml3-rb 0.2.2-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.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +9 -0
  3. data/CHANGELOG.md +43 -17
  4. data/README.md +97 -29
  5. data/lib/sfml/3.1/sfml_ext.so +0 -0
  6. data/lib/sfml/3.2/sfml_ext.so +0 -0
  7. data/lib/sfml/3.3/sfml_ext.so +0 -0
  8. data/lib/sfml/3.4/sfml_ext.so +0 -0
  9. data/lib/sfml/4.0/sfml_ext.so +0 -0
  10. data/lib/sfml/version.rb +1 -1
  11. data/sig/audio/audio_enums.rbs +30 -0
  12. data/sig/audio/listener.rbs +16 -0
  13. data/sig/audio/music.rbs +56 -0
  14. data/sig/audio/sound.rbs +51 -0
  15. data/sig/audio/sound_buffer.rbs +17 -0
  16. data/sig/audio/sound_buffer_recorder.rbs +14 -0
  17. data/sig/audio/sound_recorder.rbs +17 -0
  18. data/sig/audio/sound_source_cone.rbs +14 -0
  19. data/sig/audio/sound_stream.rbs +51 -0
  20. data/sig/graphics/blend_mode.rbs +29 -0
  21. data/sig/graphics/circle.rbs +44 -0
  22. data/sig/graphics/color.rbs +39 -0
  23. data/sig/graphics/drawable.rbs +5 -0
  24. data/sig/graphics/font.rbs +20 -0
  25. data/sig/graphics/glyph.rbs +7 -0
  26. data/sig/graphics/image.rbs +22 -0
  27. data/sig/graphics/polygon.rbs +42 -0
  28. data/sig/graphics/rect.rbs +33 -0
  29. data/sig/graphics/rectangle.rbs +42 -0
  30. data/sig/graphics/render_state.rbs +21 -0
  31. data/sig/graphics/render_texture.rbs +37 -0
  32. data/sig/graphics/shader.rbs +39 -0
  33. data/sig/graphics/shape.rbs +38 -0
  34. data/sig/graphics/sprite.rbs +34 -0
  35. data/sig/graphics/stencil_mode.rbs +18 -0
  36. data/sig/graphics/target.rbs +10 -0
  37. data/sig/graphics/text.rbs +48 -0
  38. data/sig/graphics/texture.rbs +34 -0
  39. data/sig/graphics/transform.rbs +37 -0
  40. data/sig/graphics/transformable.rbs +25 -0
  41. data/sig/graphics/vertex.rbs +17 -0
  42. data/sig/graphics/vertex_array.rbs +17 -0
  43. data/sig/graphics/vertex_buffer.rbs +22 -0
  44. data/sig/graphics/view.rbs +24 -0
  45. data/sig/network/ftp.rbs +46 -0
  46. data/sig/network/http.rbs +27 -0
  47. data/sig/network/ip_address.rbs +22 -0
  48. data/sig/network/network_enums.rbs +95 -0
  49. data/sig/network/packet.rbs +40 -0
  50. data/sig/network/socket_selector.rbs +14 -0
  51. data/sig/network/tcp_listener.rbs +13 -0
  52. data/sig/network/tcp_socket.rbs +18 -0
  53. data/sig/network/udp_socket.rbs +17 -0
  54. data/sig/system/buffer.rbs +11 -0
  55. data/sig/system/clock.rbs +13 -0
  56. data/sig/system/input_stream.rbs +7 -0
  57. data/sig/system/sleep.rbs +3 -0
  58. data/sig/system/time.rbs +28 -0
  59. data/sig/system/vec2.rbs +26 -0
  60. data/sig/system/vec3.rbs +27 -0
  61. data/sig/window/clipboard.rbs +8 -0
  62. data/sig/window/context.rbs +11 -0
  63. data/sig/window/context_settings.rbs +20 -0
  64. data/sig/window/cursor.rbs +6 -0
  65. data/sig/window/event.rbs +20 -0
  66. data/sig/window/joystick.rbs +15 -0
  67. data/sig/window/keyboard.rbs +10 -0
  68. data/sig/window/mouse.rbs +9 -0
  69. data/sig/window/sensor.rbs +8 -0
  70. data/sig/window/touch.rbs +6 -0
  71. data/sig/window/video_mode.rbs +16 -0
  72. data/sig/window/vulkan.rbs +7 -0
  73. data/sig/window/window.rbs +57 -0
  74. metadata +65 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9906cda18dc9ad5d6bb96acb9f6d92cc6f490a26292b6316a17352375194fab7
4
- data.tar.gz: c4dddeeb5f0e170caf945368ae35380490f2f9ab31fa8aedb76309b1b45f007b
3
+ metadata.gz: 519b659696edf580859c4b1d648d67befe964cda1b2e2fcabff9695a0d84024f
4
+ data.tar.gz: 2af12270fff878dbeda6c6dae4a5c9ea1c73d0b6f3e2d24815d1ce5d528d5a28
5
5
  SHA512:
6
- metadata.gz: 4a41b87099026690b343b5c29aa9f00d16d9b22217357baafd01d8d8950cf7d7d006eed3fb7c112c9c54cff6122dab9f28d7a3e267e7400a0a1d657761bacf09
7
- data.tar.gz: 489e59198a17b1d5ed056ba21bc575181d791ae6def447eadca67d324e9ef9694af5e277e5f37dd162d9dbcd02b8ef82a7fcdcfb00c001f6410c1d44ebe6665e
6
+ metadata.gz: fd11b7c1a2da069e4f8da9fa79ad2623f126f19bd970420f98561127a9e785c63f6acff50aabc94a5c6d75766fe95927031d4cf7907f1141941690f5c548488f
7
+ data.tar.gz: 200a5fbcec6896e072cf437ce7c2f53473915eaa3eccfc6416affa79e49d4b75efe73b54ac9dc69f1ab0a670cabade4bc1d6c06ddc6e359d5bcc0c8b123efa02
data/.yardopts ADDED
@@ -0,0 +1,9 @@
1
+ --markup markdown
2
+ --output-dir doc
3
+ --title sfml3-rb
4
+ --readme README.md
5
+ ext/**/*.c
6
+ -
7
+ CHANGELOG.md
8
+ TODO.md
9
+ LICENSE.md
data/CHANGELOG.md CHANGED
@@ -6,26 +6,52 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
- ### Added
10
- * **Full YARD API documentation and RBS type signatures**, covering every
11
- bound class, module, method and constant. Doc comments live in-place in
12
- the `ext/**/*.c` sources (YARD's C parser, the same convention RDoc uses),
13
- so they're published automatically to
14
- [rubydoc.info](https://rubydoc.info/gems/sfml3-rb) on release; `rake yard`
15
- builds them locally into `doc/`. `sig/**/*.rbs` ships in the gem alongside
16
- the extension sources, for IDE completion (Solargraph, RubyMine) and
17
- static type-checking (Sorbet, Steep). Run `rake rbs` to validate the
18
- signatures.
9
+ ## [0.3.0] - 2026-09-19
19
10
 
20
- ## [0.2.2]
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.
21
30
 
22
31
  ### Fixed
23
- * **The macOS binary gems now build.** SFML 3.0.2 defaults
24
- `CMAKE_OSX_DEPLOYMENT_TARGET` to 13.0, but the osxcross SDK in the
25
- rake-compiler-dock image is 11.1 and rejects a newer target, so both Darwin
26
- builds aborted while configuring SFML. The ports toolchain now pins the
27
- deployment target to macOS 11.0, which is the floor Apple Silicon requires
28
- anyway.
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).
29
55
 
30
56
  ## [0.2.1]
31
57
 
data/README.md CHANGED
@@ -2,17 +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
- ## Status
6
-
7
- Latest release: **0.2.2**. Bound against **CSFML 3**. See [TODO.md](TODO.md) for which parts of the
8
- SFML 3 API are ported so far, and [CHANGELOG.md](CHANGELOG.md) for what changed recently.
9
-
10
- API docs (every class, module, method and constant) are on
11
- [rubydoc.info](https://rubydoc.info/gems/sfml3-rb). The gem also ships RBS type signatures
12
- (`sig/**/*.rbs`) alongside the extension sources, for IDE completion (Solargraph, RubyMine) and
13
- static type-checking (Sorbet, Steep).
14
-
15
- ## Install
5
+ [![Ruby](https://img.shields.io/badge/ruby-3.1%2B-red?style=flat-square)](https://www.ruby-lang.org/)
6
+ [![Test](https://github.com/algaves/sfml3.rb/actions/workflows/test.yaml/badge.svg)](https://github.com/algaves/sfml3.rb/actions/workflows/test.yaml)
7
+ [![Check](https://github.com/algaves/sfml3.rb/actions/workflows/check.yaml/badge.svg)](https://github.com/algaves/sfml3.rb/actions/workflows/check.yaml)
8
+ [![Gem Version](https://img.shields.io/gem/v/sfml3-rb?style=flat-square)](https://rubygems.org/gems/sfml3-rb)
9
+ [![Gem Downloads](https://img.shields.io/gem/dt/sfml3-rb?style=flat-square)](https://rubygems.org/gems/sfml3-rb)
10
+ [![License](https://img.shields.io/badge/license-0BSD-green?style=flat-square)](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
16
39
 
17
40
  ```sh
18
41
  gem install sfml3-rb
@@ -29,11 +52,18 @@ already linked in — no toolchain, no build, nothing to install system-wide:
29
52
  | `x86-linux-musl` | 3.1 – 4.0 | 32-bit musl |
30
53
  | `x64-mingw-ucrt` | 3.1 – 4.0 | 64-bit Windows, RubyInstaller 3.1+ |
31
54
  | `x86-mingw32` | 3.1 – **3.4** | 32-bit Windows |
32
- | `aarch64-linux-gnu`, `x86_64-darwin`, `arm64-darwin` | 3.1 – 4.0 | experimental, not yet built |
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 |
33
59
 
34
- Each gem carries one extension per Ruby ABI. Two gaps come from upstream rather than from this
35
- project: **RubyInstaller publishes no 32-bit Ruby 4.0**, so `x86-mingw32` stops at 3.4; and 64-bit
36
- Windows before Ruby 3.1 used a different platform (`x64-mingw32`), which is not built.
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.
65
+
66
+ ### Building from source
37
67
 
38
68
  Anywhere else — macOS, ARM, the BSDs — RubyGems falls back to the source gem, which downloads and
39
69
  builds FreeType, SFML 3 and CSFML 3 from pinned, checksum-verified tarballs at install time. That
@@ -42,36 +72,39 @@ takes a few minutes and needs:
42
72
  * Ruby >= 3.1
43
73
  * A C/C++ toolchain and CMake >= 3.22
44
74
  * On Linux, the X11/udev/OpenGL development headers SFML links against — these can't be bundled.
45
- On Fedora:
46
75
 
47
- ```sh
48
- sudo dnf install cmake gcc-c++ libX11-devel \
49
- libXrandr-devel libXcursor-devel libXi-devel systemd-devel libglvnd-devel
50
- ```
76
+ On Fedora:
51
77
 
52
- or on Debian/Ubuntu:
78
+ ```sh
79
+ sudo dnf install cmake gcc-c++ libX11-devel \
80
+ libXrandr-devel libXcursor-devel libXi-devel systemd-devel libglvnd-devel
81
+ ```
53
82
 
54
- ```sh
55
- sudo apt-get install cmake build-essential libx11-dev \
56
- libxrandr-dev libxcursor-dev libxi-dev libudev-dev libgl1-mesa-dev
57
- ```
83
+ On Debian/Ubuntu:
84
+
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
+ ```
58
89
 
59
90
  Each installed gem version builds its own copy; there's no build cache shared across versions.
60
91
 
92
+ ### Linking against system libraries
93
+
61
94
  To link against a system CSFML 3 instead (no download, no build):
62
95
 
63
96
  ```sh
64
97
  gem install sfml3-rb -- --enable-system-libraries
65
98
  ```
66
99
 
67
- ## Usage
100
+ ## Quick Start
68
101
 
69
102
  ```ruby
70
103
  require 'sfml'
71
104
  include SFML
72
105
 
73
106
  window = Window.new VideoMode.new(640, 480, 32), 'SFML'
74
- event = Event.new
107
+ event = Event.new
75
108
 
76
109
  while window.is_open?
77
110
  while window.poll_event! event
@@ -83,7 +116,20 @@ while window.is_open?
83
116
  end
84
117
  ```
85
118
 
86
- See [`test/hello-world.rb`](test/hello-world.rb) for a fuller example with shapes and transforms.
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.
87
133
 
88
134
  ## Development
89
135
 
@@ -138,9 +184,31 @@ mingw toolchain and the osxcross SDK already provide.
138
184
  Binary gems carry one extension per Ruby ABI under `lib/sfml/<major.minor>/`; `lib/sfml.rb` prefers
139
185
  that and falls back to the single `lib/sfml/sfml_ext.so` a source build installs.
140
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
+
141
209
  ## License
142
210
 
143
- [0BSD](LICENSE.md)
211
+ This project is licensed under the BSD Zero Clause License (0BSD) - see the [LICENSE](LICENSE.md) file for details.
144
212
 
145
213
  ---
146
214
 
Binary file
Binary file
Binary file
Binary file
Binary file
data/lib/sfml/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SFML
4
- VERSION = '0.2.2'
4
+ VERSION = '0.3.0'
5
5
  end
@@ -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
@@ -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
@@ -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