teek-sdl2 0.1.0 → 0.1.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.
- checksums.yaml +4 -4
- data/ext/teek_sdl2/extconf.rb +25 -4
- data/ext/teek_sdl2/sdl2gamepad.c +875 -0
- data/ext/teek_sdl2/sdl2mixer.c +819 -0
- data/ext/teek_sdl2/teek_sdl2.c +6 -0
- data/ext/teek_sdl2/teek_sdl2.h +2 -0
- data/lib/teek/sdl2/gamepad.rb +59 -0
- data/lib/teek/sdl2/music.rb +21 -0
- data/lib/teek/sdl2/sound.rb +19 -0
- data/lib/teek/sdl2/version.rb +1 -1
- data/lib/teek/sdl2.rb +3 -0
- data/test/test_audio_capture.rb +108 -0
- data/test/test_gamepad.rb +467 -0
- data/test/test_mixer.rb +117 -0
- metadata +9 -2
- data/test/test_callback_teardown.rb +0 -35
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 42e232c86750e8313a051b00099dc677fa26888e8f0eace2a0fd2101b4d5aebd
|
|
4
|
+
data.tar.gz: ae409b3dae88d5b89c3f5c4552fbd761ae627200c5c7a1ed6859682d5aa61197
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 89acada5767fe800d184cc8881053b4b76a0f75cb0742eb150d43567005a4f0474f8ccbad012bc991496e01cbf6c416519f1904c2451dbc866903aac9dad1c12
|
|
7
|
+
data.tar.gz: dbbbb729914e2c17321889c958a4381547ba4944c7ab3f0c313ee8e91ae42695ebc077b0520d5dea4574fc583d9cb2d0dd30545c1c1d6a896ceab4223f561c72
|
data/ext/teek_sdl2/extconf.rb
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
require 'mkmf'
|
|
4
4
|
|
|
5
|
+
# Detect MSYS2 package prefix based on Ruby's platform.
|
|
6
|
+
# UCRT builds (Ruby 3.1+) use mingw-w64-ucrt-x86_64-*, older MINGW64
|
|
7
|
+
# builds use mingw-w64-x86_64-*.
|
|
8
|
+
def msys2_pkg_prefix
|
|
9
|
+
if RUBY_PLATFORM.include?('ucrt')
|
|
10
|
+
'mingw-w64-ucrt-x86_64'
|
|
11
|
+
else
|
|
12
|
+
'mingw-w64-x86_64'
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
5
16
|
def find_sdl2
|
|
6
17
|
# 1. Try SDL2_DIR env var first (explicit override)
|
|
7
18
|
if ENV['SDL2_DIR']
|
|
@@ -82,7 +93,7 @@ unless find_sdl2
|
|
|
82
93
|
SDL2 not found. Install it:
|
|
83
94
|
macOS: brew install sdl2
|
|
84
95
|
Debian: sudo apt-get install libsdl2-dev
|
|
85
|
-
Windows: pacman -S
|
|
96
|
+
Windows: pacman -S #{msys2_pkg_prefix}-SDL2 (MSYS2)
|
|
86
97
|
Or set SDL2_DIR=/path/to/sdl2
|
|
87
98
|
MSG
|
|
88
99
|
end
|
|
@@ -93,7 +104,7 @@ unless pkg_config('SDL2_ttf') || have_library('SDL2_ttf', 'TTF_Init', 'SDL2/SDL_
|
|
|
93
104
|
SDL2_ttf not found. Install it:
|
|
94
105
|
macOS: brew install sdl2_ttf
|
|
95
106
|
Debian: sudo apt-get install libsdl2-ttf-dev
|
|
96
|
-
Windows: pacman -S
|
|
107
|
+
Windows: pacman -S #{msys2_pkg_prefix}-SDL2_ttf (MSYS2)
|
|
97
108
|
MSG
|
|
98
109
|
end
|
|
99
110
|
|
|
@@ -103,10 +114,20 @@ unless pkg_config('SDL2_image') || have_library('SDL2_image', 'IMG_Init', 'SDL2/
|
|
|
103
114
|
SDL2_image not found. Install it:
|
|
104
115
|
macOS: brew install sdl2_image
|
|
105
116
|
Debian: sudo apt-get install libsdl2-image-dev
|
|
106
|
-
Windows: pacman -S
|
|
117
|
+
Windows: pacman -S #{msys2_pkg_prefix}-SDL2_image (MSYS2)
|
|
118
|
+
MSG
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# SDL2_mixer for audio playback
|
|
122
|
+
unless pkg_config('SDL2_mixer') || have_library('SDL2_mixer', 'Mix_OpenAudio', 'SDL2/SDL_mixer.h')
|
|
123
|
+
abort <<~MSG
|
|
124
|
+
SDL2_mixer not found. Install it:
|
|
125
|
+
macOS: brew install sdl2_mixer
|
|
126
|
+
Debian: sudo apt-get install libsdl2-mixer-dev
|
|
127
|
+
Windows: pacman -S #{msys2_pkg_prefix}-SDL2_mixer (MSYS2)
|
|
107
128
|
MSG
|
|
108
129
|
end
|
|
109
130
|
|
|
110
|
-
$srcs = ['teek_sdl2.c', 'sdl2surface.c', 'sdl2bridge.c', 'sdl2text.c', 'sdl2pixels.c', 'sdl2image.c']
|
|
131
|
+
$srcs = ['teek_sdl2.c', 'sdl2surface.c', 'sdl2bridge.c', 'sdl2text.c', 'sdl2pixels.c', 'sdl2image.c', 'sdl2mixer.c', 'sdl2gamepad.c']
|
|
111
132
|
|
|
112
133
|
create_makefile('teek_sdl2')
|