sdl2-bindings 0.1.5 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ca4423c0218ca2efe6fd3522958924fb2f80a7f8f4306297eb4be53aaea8fc4b
4
- data.tar.gz: a55940e461db8235156d115de6fc775421e69e34506e16310f99fa952b18e559
3
+ metadata.gz: 25b91bcb457fecf36bfa667b829977816bfcc4348a2b926676aa04f2ae2c71a8
4
+ data.tar.gz: 6c807ef1fa2a8cbae4457cc7cdf255f2358a425f46d2fd4535234f716f1e266a
5
5
  SHA512:
6
- metadata.gz: b65767f1f1f62aafeb0cfb1ad18aacee9064cb8d4b320f722de7ec64be0d97528794bda50e56545a9627ad57ff7a0e14a79ca5fe094d42dc881fde4af9ca0f4c
7
- data.tar.gz: 1a4d46c4aa8e7dd30db494f0db17883f6ea01a40ebbd550a0bbf51c683d0680dd9e879845b620d6c7e8d8743fedc2abe1ba80463d9b92ab2d2c26a661de9df77
6
+ metadata.gz: 0b51083c4a27bb14ed410c07186db196ac3454b22bf39e1119e82843799142c0fa2e600a48000158b986562f8adecf9b2e6e7c6d660a1744ff7d60d0f566fc81
7
+ data.tar.gz: d3e0cb0fc66b152ea8f69e909df7d46d804948f359a95a1f2d2fb131de7cda98c71dc36495d9ecb276d23a278c669e7ac1e4b1351c066416368d377d99df9e33
data/ChangeLog CHANGED
@@ -1,3 +1,12 @@
1
+ 2023-02-05 vaiorabbit <http://twitter.com/vaiorabbit>
2
+
3
+ * lib/sdl2_syswm.rb: Added X11 support
4
+ * Added Linux (on WSL) as a tested environment
5
+
6
+ 2022-11-23 vaiorabbit <http://twitter.com/vaiorabbit>
7
+
8
+ * SDL 2.26.0 ( https://github.com/libsdl-org/SDL/releases/tag/release-2.26.0 )
9
+
1
10
  2022-10-09 vaiorabbit <http://twitter.com/vaiorabbit>
2
11
 
3
12
  * SDL 2.24.1 ( https://github.com/libsdl-org/SDL/releases/tag/release-2.24.1 )
data/LICENSE.txt CHANGED
@@ -1,5 +1,5 @@
1
1
  sdl2-bindings : Yet another SDL2 wrapper for Ruby
2
- Copyright (c) 2015-2022 vaiorabbit <http://twitter.com/vaiorabbit>
2
+ Copyright (c) 2015-2023 vaiorabbit <http://twitter.com/vaiorabbit>
3
3
 
4
4
  This software is provided 'as-is', without any express or implied
5
5
  warranty. In no event will the authors be held liable for any damages
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  # sdl2-bindings : Yet another SDL2 wrapper for Ruby #
4
4
 
5
5
  * Created : 2015-09-19
6
- * Last modified : 2022-10-09
6
+ * Last modified : 2023-02-05
7
7
 
8
8
  ## Features ##
9
9
 
@@ -23,8 +23,8 @@ See the project below to learn how to use this library:
23
23
 
24
24
  ## Target version ##
25
25
 
26
- * [2022-10-09]
27
- * SDL : 2.24.1
26
+ * [2022-11-23]
27
+ * SDL : 2.26.0 - 2.26.2
28
28
  * SDL_image : 2.6.2
29
29
  * SDL_mixer : 2.6.2
30
30
  * SDL_ttf : 2.20.1
@@ -69,18 +69,35 @@ See the project below to learn how to use this library:
69
69
  * SDL_ttf : 2.20.1
70
70
  * SDL2_gfx : 1.0.4
71
71
  * SDL_sound : 2.0.1
72
+ * [2022-10-09]
73
+ * SDL : 2.24.1
74
+ * SDL_image : 2.6.2
75
+ * SDL_mixer : 2.6.2
76
+ * SDL_ttf : 2.20.1
77
+ * SDL2_gfx : 1.0.4
78
+ * SDL_sound : 2.0.1
79
+ * [2022-11-03]
80
+ * SDL : 2.24.2
81
+ * SDL_image : 2.6.2
82
+ * SDL_mixer : 2.6.2
83
+ * SDL_ttf : 2.20.1
84
+ * SDL2_gfx : 1.0.4
85
+ * SDL_sound : 2.0.1
72
86
 
73
87
  </details>
74
88
 
75
89
  ## Supported Environments ##
76
90
 
77
- * [2022-04-29] Windows 10 (21H1), ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x64-mingw-ucrt]
78
- * [2022-10-09] macOS Monterey (12.5.1), ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin21]
91
+ * [2023-01-07] Windows 11 (22H2), ruby 3.2.0 (2022-12-25 revision a528908271) [x64-mingw-ucrt]
92
+ * [2023-01-07] macOS Ventura (13.1) ruby 3.2.0 (2022-12-25 revision a528908271) [arm64-darwin21]
79
93
  * [2022-10-09] Debian 11 (bullseye) on ASUS Chromebook Detachable CZ1, ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [aarch64-linux]
94
+ * [2023-02-05] Ubuntu Linux 22.04 LTS (jammy) on WSL/Windows 11, ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-linux]
80
95
 
81
96
  <details>
82
97
  <summary>Older Environments</summary>
83
98
 
99
+ * [2022-04-29] Windows 10 (21H1), ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x64-mingw-ucrt]
100
+ * [2022-10-09] macOS Monterey (12.5.1), ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin21]
84
101
  * [2022-07-31] macOS Monterey (12.4), ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [arm64-darwin21]
85
102
  * [2022-02-12] Windows 10 (21H1), ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x64-mingw-ucrt]
86
103
  * [2022-01-11] macOS Monterey (12.1), ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [arm64-darwin20]
@@ -97,7 +114,7 @@ See the project below to learn how to use this library:
97
114
  The zlib/libpng License ( http://opensource.org/licenses/Zlib ).
98
115
 
99
116
  sdl2-bindings : Yet another SDL2 wrapper for Ruby
100
- Copyright (c) 2015-2022 vaiorabbit <http://twitter.com/vaiorabbit>
117
+ Copyright (c) 2015-2023 vaiorabbit <http://twitter.com/vaiorabbit>
101
118
 
102
119
  This software is provided 'as-is', without any express or implied
103
120
  warranty. In no event will the authors be held liable for any damages
@@ -27,21 +27,33 @@ module SDL
27
27
  :SDL_SetClipboardText,
28
28
  :SDL_GetClipboardText,
29
29
  :SDL_HasClipboardText,
30
+ :SDL_SetPrimarySelectionText,
31
+ :SDL_GetPrimarySelectionText,
32
+ :SDL_HasPrimarySelectionText,
30
33
  ]
31
34
  apis = {
32
35
  :SDL_SetClipboardText => :SetClipboardText,
33
36
  :SDL_GetClipboardText => :GetClipboardText,
34
37
  :SDL_HasClipboardText => :HasClipboardText,
38
+ :SDL_SetPrimarySelectionText => :SetPrimarySelectionText,
39
+ :SDL_GetPrimarySelectionText => :GetPrimarySelectionText,
40
+ :SDL_HasPrimarySelectionText => :HasPrimarySelectionText,
35
41
  }
36
42
  args = {
37
43
  :SDL_SetClipboardText => [:pointer],
38
44
  :SDL_GetClipboardText => [],
39
45
  :SDL_HasClipboardText => [],
46
+ :SDL_SetPrimarySelectionText => [:pointer],
47
+ :SDL_GetPrimarySelectionText => [],
48
+ :SDL_HasPrimarySelectionText => [],
40
49
  }
41
50
  retvals = {
42
51
  :SDL_SetClipboardText => :int,
43
52
  :SDL_GetClipboardText => :pointer,
44
53
  :SDL_HasClipboardText => :int,
54
+ :SDL_SetPrimarySelectionText => :int,
55
+ :SDL_GetPrimarySelectionText => :pointer,
56
+ :SDL_HasPrimarySelectionText => :int,
45
57
  }
46
58
  symbols.each do |sym|
47
59
  begin
data/lib/sdl2_events.rb CHANGED
@@ -211,6 +211,8 @@ module SDL
211
211
  :direction, :uint,
212
212
  :preciseX, :float,
213
213
  :preciseY, :float,
214
+ :mouseX, :int,
215
+ :mouseY, :int,
214
216
  )
215
217
  end
216
218
 
@@ -337,6 +339,7 @@ module SDL
337
339
  :which, :int,
338
340
  :sensor, :int,
339
341
  :data, [:float, 3],
342
+ :timestamp_us, :ulong_long,
340
343
  )
341
344
  end
342
345
 
@@ -409,6 +412,7 @@ module SDL
409
412
  :timestamp, :uint,
410
413
  :which, :int,
411
414
  :data, [:float, 6],
415
+ :timestamp_us, :ulong_long,
412
416
  )
413
417
  end
414
418
 
@@ -147,6 +147,7 @@ module SDL
147
147
  :SDL_GameControllerIsSensorEnabled,
148
148
  :SDL_GameControllerGetSensorDataRate,
149
149
  :SDL_GameControllerGetSensorData,
150
+ :SDL_GameControllerGetSensorDataWithTimestamp,
150
151
  :SDL_GameControllerRumble,
151
152
  :SDL_GameControllerRumbleTriggers,
152
153
  :SDL_GameControllerHasLED,
@@ -205,6 +206,7 @@ module SDL
205
206
  :SDL_GameControllerIsSensorEnabled => :GameControllerIsSensorEnabled,
206
207
  :SDL_GameControllerGetSensorDataRate => :GameControllerGetSensorDataRate,
207
208
  :SDL_GameControllerGetSensorData => :GameControllerGetSensorData,
209
+ :SDL_GameControllerGetSensorDataWithTimestamp => :GameControllerGetSensorDataWithTimestamp,
208
210
  :SDL_GameControllerRumble => :GameControllerRumble,
209
211
  :SDL_GameControllerRumbleTriggers => :GameControllerRumbleTriggers,
210
212
  :SDL_GameControllerHasLED => :GameControllerHasLED,
@@ -263,6 +265,7 @@ module SDL
263
265
  :SDL_GameControllerIsSensorEnabled => [:pointer, :int],
264
266
  :SDL_GameControllerGetSensorDataRate => [:pointer, :int],
265
267
  :SDL_GameControllerGetSensorData => [:pointer, :int, :pointer, :int],
268
+ :SDL_GameControllerGetSensorDataWithTimestamp => [:pointer, :int, :pointer, :pointer, :int],
266
269
  :SDL_GameControllerRumble => [:pointer, :ushort, :ushort, :uint],
267
270
  :SDL_GameControllerRumbleTriggers => [:pointer, :ushort, :ushort, :uint],
268
271
  :SDL_GameControllerHasLED => [:pointer],
@@ -321,6 +324,7 @@ module SDL
321
324
  :SDL_GameControllerIsSensorEnabled => :int,
322
325
  :SDL_GameControllerGetSensorDataRate => :float,
323
326
  :SDL_GameControllerGetSensorData => :int,
327
+ :SDL_GameControllerGetSensorDataWithTimestamp => :int,
324
328
  :SDL_GameControllerRumble => :int,
325
329
  :SDL_GameControllerRumbleTriggers => :int,
326
330
  :SDL_GameControllerHasLED => :int,
data/lib/sdl2_hints.rb CHANGED
@@ -43,6 +43,7 @@ module SDL
43
43
  HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT = "SDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT"
44
44
  HINT_GAMECONTROLLER_USE_BUTTON_LABELS = "SDL_GAMECONTROLLER_USE_BUTTON_LABELS"
45
45
  HINT_GRAB_KEYBOARD = "SDL_GRAB_KEYBOARD"
46
+ HINT_HIDAPI_IGNORE_DEVICES = "SDL_HIDAPI_IGNORE_DEVICES"
46
47
  HINT_IDLE_TIMER_DISABLED = "SDL_IOS_IDLE_TIMER_DISABLED"
47
48
  HINT_IME_INTERNAL_EDITING = "SDL_IME_INTERNAL_EDITING"
48
49
  HINT_IME_SHOW_UI = "SDL_IME_SHOW_UI"
@@ -54,9 +55,11 @@ module SDL
54
55
  HINT_JOYSTICK_GAMECUBE_RUMBLE_BRAKE = "SDL_JOYSTICK_GAMECUBE_RUMBLE_BRAKE"
55
56
  HINT_JOYSTICK_HIDAPI_JOY_CONS = "SDL_JOYSTICK_HIDAPI_JOY_CONS"
56
57
  HINT_JOYSTICK_HIDAPI_COMBINE_JOY_CONS = "SDL_JOYSTICK_HIDAPI_COMBINE_JOY_CONS"
58
+ HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS = "SDL_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS"
57
59
  HINT_JOYSTICK_HIDAPI_LUNA = "SDL_JOYSTICK_HIDAPI_LUNA"
58
60
  HINT_JOYSTICK_HIDAPI_NINTENDO_CLASSIC = "SDL_JOYSTICK_HIDAPI_NINTENDO_CLASSIC"
59
61
  HINT_JOYSTICK_HIDAPI_SHIELD = "SDL_JOYSTICK_HIDAPI_SHIELD"
62
+ HINT_JOYSTICK_HIDAPI_PS3 = "SDL_JOYSTICK_HIDAPI_PS3"
60
63
  HINT_JOYSTICK_HIDAPI_PS4 = "SDL_JOYSTICK_HIDAPI_PS4"
61
64
  HINT_JOYSTICK_HIDAPI_PS4_RUMBLE = "SDL_JOYSTICK_HIDAPI_PS4_RUMBLE"
62
65
  HINT_JOYSTICK_HIDAPI_PS5 = "SDL_JOYSTICK_HIDAPI_PS5"
@@ -68,7 +71,14 @@ module SDL
68
71
  HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED = "SDL_JOYSTICK_HIDAPI_SWITCH_HOME_LED"
69
72
  HINT_JOYSTICK_HIDAPI_JOYCON_HOME_LED = "SDL_JOYSTICK_HIDAPI_JOYCON_HOME_LED"
70
73
  HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED = "SDL_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED"
74
+ HINT_JOYSTICK_HIDAPI_WII = "SDL_JOYSTICK_HIDAPI_WII"
75
+ HINT_JOYSTICK_HIDAPI_WII_PLAYER_LED = "SDL_JOYSTICK_HIDAPI_WII_PLAYER_LED"
71
76
  HINT_JOYSTICK_HIDAPI_XBOX = "SDL_JOYSTICK_HIDAPI_XBOX"
77
+ HINT_JOYSTICK_HIDAPI_XBOX_360 = "SDL_JOYSTICK_HIDAPI_XBOX_360"
78
+ HINT_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED = "SDL_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED"
79
+ HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS = "SDL_JOYSTICK_HIDAPI_XBOX_360_WIRELESS"
80
+ HINT_JOYSTICK_HIDAPI_XBOX_ONE = "SDL_JOYSTICK_HIDAPI_XBOX_ONE"
81
+ HINT_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED = "SDL_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED"
72
82
  HINT_JOYSTICK_RAWINPUT = "SDL_JOYSTICK_RAWINPUT"
73
83
  HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT = "SDL_JOYSTICK_RAWINPUT_CORRELATE_XINPUT"
74
84
  HINT_JOYSTICK_ROG_CHAKRAM = "SDL_JOYSTICK_ROG_CHAKRAM"
@@ -90,6 +100,7 @@ module SDL
90
100
  HINT_MOUSE_RELATIVE_MODE_WARP = "SDL_MOUSE_RELATIVE_MODE_WARP"
91
101
  HINT_MOUSE_RELATIVE_SCALING = "SDL_MOUSE_RELATIVE_SCALING"
92
102
  HINT_MOUSE_RELATIVE_SPEED_SCALE = "SDL_MOUSE_RELATIVE_SPEED_SCALE"
103
+ HINT_MOUSE_RELATIVE_SYSTEM_SCALE = "SDL_MOUSE_RELATIVE_SYSTEM_SCALE"
93
104
  HINT_MOUSE_RELATIVE_WARP_MOTION = "SDL_MOUSE_RELATIVE_WARP_MOTION"
94
105
  HINT_MOUSE_TOUCH_EVENTS = "SDL_MOUSE_TOUCH_EVENTS"
95
106
  HINT_MOUSE_AUTO_CAPTURE = "SDL_MOUSE_AUTO_CAPTURE"
@@ -109,6 +120,7 @@ module SDL
109
120
  HINT_RENDER_OPENGL_SHADERS = "SDL_RENDER_OPENGL_SHADERS"
110
121
  HINT_RENDER_SCALE_QUALITY = "SDL_RENDER_SCALE_QUALITY"
111
122
  HINT_RENDER_VSYNC = "SDL_RENDER_VSYNC"
123
+ HINT_PS2_DYNAMIC_VSYNC = "SDL_PS2_DYNAMIC_VSYNC"
112
124
  HINT_RETURN_KEY_HIDES_IME = "SDL_RETURN_KEY_HIDES_IME"
113
125
  HINT_RPI_VIDEO_LAYER = "SDL_RPI_VIDEO_LAYER"
114
126
  HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME = "SDL_SCREENSAVER_INHIBIT_ACTIVITY_NAME"
@@ -129,6 +141,7 @@ module SDL
129
141
  HINT_VIDEO_WAYLAND_ALLOW_LIBDECOR = "SDL_VIDEO_WAYLAND_ALLOW_LIBDECOR"
130
142
  HINT_VIDEO_WAYLAND_PREFER_LIBDECOR = "SDL_VIDEO_WAYLAND_PREFER_LIBDECOR"
131
143
  HINT_VIDEO_WAYLAND_MODE_EMULATION = "SDL_VIDEO_WAYLAND_MODE_EMULATION"
144
+ HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP = "SDL_VIDEO_WAYLAND_EMULATE_MOUSE_WARP"
132
145
  HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT = "SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT"
133
146
  HINT_VIDEO_FOREIGN_WINDOW_OPENGL = "SDL_VIDEO_FOREIGN_WINDOW_OPENGL"
134
147
  HINT_VIDEO_FOREIGN_WINDOW_VULKAN = "SDL_VIDEO_FOREIGN_WINDOW_VULKAN"
@@ -191,6 +204,7 @@ module SDL
191
204
  :SDL_SetHintWithPriority,
192
205
  :SDL_SetHint,
193
206
  :SDL_ResetHint,
207
+ :SDL_ResetHints,
194
208
  :SDL_GetHint,
195
209
  :SDL_GetHintBoolean,
196
210
  :SDL_AddHintCallback,
@@ -201,6 +215,7 @@ module SDL
201
215
  :SDL_SetHintWithPriority => :SetHintWithPriority,
202
216
  :SDL_SetHint => :SetHint,
203
217
  :SDL_ResetHint => :ResetHint,
218
+ :SDL_ResetHints => :ResetHints,
204
219
  :SDL_GetHint => :GetHint,
205
220
  :SDL_GetHintBoolean => :GetHintBoolean,
206
221
  :SDL_AddHintCallback => :AddHintCallback,
@@ -211,6 +226,7 @@ module SDL
211
226
  :SDL_SetHintWithPriority => [:pointer, :pointer, :int],
212
227
  :SDL_SetHint => [:pointer, :pointer],
213
228
  :SDL_ResetHint => [:pointer],
229
+ :SDL_ResetHints => [],
214
230
  :SDL_GetHint => [:pointer],
215
231
  :SDL_GetHintBoolean => [:pointer, :int],
216
232
  :SDL_AddHintCallback => [:pointer, :SDL_HintCallback, :pointer],
@@ -221,6 +237,7 @@ module SDL
221
237
  :SDL_SetHintWithPriority => :int,
222
238
  :SDL_SetHint => :int,
223
239
  :SDL_ResetHint => :int,
240
+ :SDL_ResetHints => :void,
224
241
  :SDL_GetHint => :pointer,
225
242
  :SDL_GetHintBoolean => :int,
226
243
  :SDL_AddHintCallback => :void,
data/lib/sdl2_joystick.rb CHANGED
@@ -119,6 +119,7 @@ module SDL
119
119
  :SDL_JoystickGetType,
120
120
  :SDL_JoystickGetGUIDString,
121
121
  :SDL_JoystickGetGUIDFromString,
122
+ :SDL_GetJoystickGUIDInfo,
122
123
  :SDL_JoystickGetAttached,
123
124
  :SDL_JoystickInstanceID,
124
125
  :SDL_JoystickNumAxes,
@@ -178,6 +179,7 @@ module SDL
178
179
  :SDL_JoystickGetType => :JoystickGetType,
179
180
  :SDL_JoystickGetGUIDString => :JoystickGetGUIDString,
180
181
  :SDL_JoystickGetGUIDFromString => :JoystickGetGUIDFromString,
182
+ :SDL_GetJoystickGUIDInfo => :GetJoystickGUIDInfo,
181
183
  :SDL_JoystickGetAttached => :JoystickGetAttached,
182
184
  :SDL_JoystickInstanceID => :JoystickInstanceID,
183
185
  :SDL_JoystickNumAxes => :JoystickNumAxes,
@@ -237,6 +239,7 @@ module SDL
237
239
  :SDL_JoystickGetType => [:pointer],
238
240
  :SDL_JoystickGetGUIDString => [JoystickGUID.by_value, :pointer, :int],
239
241
  :SDL_JoystickGetGUIDFromString => [:pointer],
242
+ :SDL_GetJoystickGUIDInfo => [JoystickGUID.by_value, :pointer, :pointer, :pointer, :pointer],
240
243
  :SDL_JoystickGetAttached => [:pointer],
241
244
  :SDL_JoystickInstanceID => [:pointer],
242
245
  :SDL_JoystickNumAxes => [:pointer],
@@ -296,6 +299,7 @@ module SDL
296
299
  :SDL_JoystickGetType => :int,
297
300
  :SDL_JoystickGetGUIDString => :void,
298
301
  :SDL_JoystickGetGUIDFromString => JoystickGUID.by_value,
302
+ :SDL_GetJoystickGUIDInfo => :void,
299
303
  :SDL_JoystickGetAttached => :int,
300
304
  :SDL_JoystickInstanceID => :int,
301
305
  :SDL_JoystickNumAxes => :int,
data/lib/sdl2_sensor.rb CHANGED
@@ -18,6 +18,10 @@ module SDL
18
18
  SENSOR_UNKNOWN = 0
19
19
  SENSOR_ACCEL = 1
20
20
  SENSOR_GYRO = 2
21
+ SENSOR_ACCEL_L = 3
22
+ SENSOR_GYRO_L = 4
23
+ SENSOR_ACCEL_R = 5
24
+ SENSOR_GYRO_R = 6
21
25
 
22
26
  # Typedef
23
27
 
@@ -45,6 +49,7 @@ module SDL
45
49
  :SDL_SensorGetNonPortableType,
46
50
  :SDL_SensorGetInstanceID,
47
51
  :SDL_SensorGetData,
52
+ :SDL_SensorGetDataWithTimestamp,
48
53
  :SDL_SensorClose,
49
54
  :SDL_SensorUpdate,
50
55
  ]
@@ -63,6 +68,7 @@ module SDL
63
68
  :SDL_SensorGetNonPortableType => :SensorGetNonPortableType,
64
69
  :SDL_SensorGetInstanceID => :SensorGetInstanceID,
65
70
  :SDL_SensorGetData => :SensorGetData,
71
+ :SDL_SensorGetDataWithTimestamp => :SensorGetDataWithTimestamp,
66
72
  :SDL_SensorClose => :SensorClose,
67
73
  :SDL_SensorUpdate => :SensorUpdate,
68
74
  }
@@ -81,6 +87,7 @@ module SDL
81
87
  :SDL_SensorGetNonPortableType => [:pointer],
82
88
  :SDL_SensorGetInstanceID => [:pointer],
83
89
  :SDL_SensorGetData => [:pointer, :pointer, :int],
90
+ :SDL_SensorGetDataWithTimestamp => [:pointer, :pointer, :pointer, :int],
84
91
  :SDL_SensorClose => [:pointer],
85
92
  :SDL_SensorUpdate => [],
86
93
  }
@@ -99,6 +106,7 @@ module SDL
99
106
  :SDL_SensorGetNonPortableType => :int,
100
107
  :SDL_SensorGetInstanceID => :int,
101
108
  :SDL_SensorGetData => :int,
109
+ :SDL_SensorGetDataWithTimestamp => :int,
102
110
  :SDL_SensorClose => :void,
103
111
  :SDL_SensorUpdate => :void,
104
112
  }
data/lib/sdl2_stdinc.rb CHANGED
@@ -105,6 +105,7 @@ module SDL
105
105
  :SDL_strchr,
106
106
  :SDL_strrchr,
107
107
  :SDL_strstr,
108
+ :SDL_strcasestr,
108
109
  :SDL_strtokr,
109
110
  :SDL_utf8strlen,
110
111
  :SDL_utf8strnlen,
@@ -232,6 +233,7 @@ module SDL
232
233
  :SDL_strchr => :strchr,
233
234
  :SDL_strrchr => :strrchr,
234
235
  :SDL_strstr => :strstr,
236
+ :SDL_strcasestr => :strcasestr,
235
237
  :SDL_strtokr => :strtokr,
236
238
  :SDL_utf8strlen => :utf8strlen,
237
239
  :SDL_utf8strnlen => :utf8strnlen,
@@ -359,6 +361,7 @@ module SDL
359
361
  :SDL_strchr => [:pointer, :int],
360
362
  :SDL_strrchr => [:pointer, :int],
361
363
  :SDL_strstr => [:pointer, :pointer],
364
+ :SDL_strcasestr => [:pointer, :pointer],
362
365
  :SDL_strtokr => [:pointer, :pointer, :pointer],
363
366
  :SDL_utf8strlen => [:pointer],
364
367
  :SDL_utf8strnlen => [:pointer, :ulong],
@@ -486,6 +489,7 @@ module SDL
486
489
  :SDL_strchr => :pointer,
487
490
  :SDL_strrchr => :pointer,
488
491
  :SDL_strstr => :pointer,
492
+ :SDL_strcasestr => :pointer,
489
493
  :SDL_strtokr => :pointer,
490
494
  :SDL_utf8strlen => :size_t,
491
495
  :SDL_utf8strnlen => :size_t,
data/lib/sdl2_syswm.rb CHANGED
@@ -37,47 +37,69 @@ module SDL
37
37
 
38
38
  class SysWMmsg_def_win < FFI::Struct
39
39
  layout(
40
- :hwnd, :pointer,
41
- :msg, :uint32,
42
- :wParam, :uint64,
43
- :lParam, :int64
40
+ :hwnd, :pointer,
41
+ :msg, :uint32,
42
+ :wParam, :uint64,
43
+ :lParam, :int64
44
44
  )
45
45
  end
46
46
 
47
47
  class SysWMmsg_value_win < FFI::Union
48
48
  layout(
49
- :win, SysWMmsg_def_win.by_value,
50
- :dummy, :int
49
+ :win, SysWMmsg_def_win.by_value,
50
+ :dummy, :int
51
51
  )
52
52
  end
53
53
 
54
54
  class SysWMmsg_win < FFI::Struct
55
55
  layout(
56
- :version, Version.by_value,
57
- :subsystem, :int,
58
- :msg, SysWMmsg_value_win.by_value
56
+ :version, Version.by_value,
57
+ :subsystem, :int,
58
+ :msg, SysWMmsg_value_win.by_value
59
59
  )
60
60
  end
61
61
 
62
62
 
63
63
  class SysWMmsg_def_cocoa < FFI::Struct
64
64
  layout(
65
- :dummy, :int
65
+ :dummy, :int
66
66
  )
67
67
  end
68
68
 
69
69
  class SysWMmsg_value_cocoa < FFI::Union
70
70
  layout(
71
- :cocoa, SysWMmsg_def_cocoa.by_value,
72
- :dummy, :int
71
+ :cocoa, SysWMmsg_def_cocoa.by_value,
72
+ :dummy, :int
73
73
  )
74
74
  end
75
75
 
76
76
  class SysWMmsg_cocoa < FFI::Struct
77
77
  layout(
78
- :version, Version.by_value,
79
- :subsystem, :int,
80
- :msg, SysWMmsg_value_cocoa.by_value
78
+ :version, Version.by_value,
79
+ :subsystem, :int,
80
+ :msg, SysWMmsg_value_cocoa.by_value
81
+ )
82
+ end
83
+
84
+
85
+ class SysWMmsg_def_x11 < FFI::Struct
86
+ layout(
87
+ :event, [:long, 24] # /usr/include/X11/Xlib.h
88
+ )
89
+ end
90
+
91
+ class SysWMmsg_value_x11 < FFI::Union
92
+ layout(
93
+ :x11, SysWMmsg_def_x11.by_value,
94
+ :dummy, :int
95
+ )
96
+ end
97
+
98
+ class SysWMmsg_x11 < FFI::Struct
99
+ layout(
100
+ :version, Version.by_value,
101
+ :subsystem, :int,
102
+ :msg, SysWMmsg_value_x11.by_value
81
103
  )
82
104
  end
83
105
 
@@ -85,46 +107,98 @@ module SDL
85
107
 
86
108
  class SysWMinfo_def_win < FFI::Struct
87
109
  layout(
88
- :window, :pointer,
89
- :hdc, :pointer,
90
- :hinstance, :pointer
110
+ :window, :pointer,
111
+ :hdc, :pointer,
112
+ :hinstance, :pointer
91
113
  )
92
114
  end
93
115
 
94
116
  class SysWMinfo_value_win < FFI::Union
95
117
  layout(
96
- :win, SysWMinfo_def_win.by_value,
97
- :dummy, [:uint8, 64]
118
+ :win, SysWMinfo_def_win.by_value,
119
+ :dummy, [:uint8, 64]
98
120
  )
99
121
  end
100
122
 
101
123
  class SysWMinfo_win < FFI::Struct
102
124
  layout(
103
- :version, Version.by_value,
104
- :subsystem, :int,
105
- :info, SysWMinfo_value_win.by_value
125
+ :version, Version.by_value,
126
+ :subsystem, :int,
127
+ :info, SysWMinfo_value_win.by_value
106
128
  )
107
129
  end
108
130
 
109
131
 
110
132
  class SysWMinfo_def_cocoa < FFI::Struct
111
133
  layout(
112
- :window, :pointer
134
+ :window, :pointer
113
135
  )
114
136
  end
115
137
 
116
138
  class SysWMinfo_value_cocoa < FFI::Union
117
139
  layout(
118
- :cocoa, SysWMinfo_def_cocoa.by_value,
119
- :dummy, [:uint8, 64]
140
+ :cocoa, SysWMinfo_def_cocoa.by_value,
141
+ :dummy, [:uint8, 64]
120
142
  )
121
143
  end
122
144
 
123
145
  class SysWMinfo_cocoa < FFI::Struct
124
146
  layout(
125
- :version, Version.by_value,
126
- :subsystem, :int,
127
- :info, SysWMinfo_value_cocoa.by_value
147
+ :version, Version.by_value,
148
+ :subsystem, :int,
149
+ :info, SysWMinfo_value_cocoa.by_value
150
+ )
151
+ end
152
+
153
+
154
+ class SysWMinfo_def_x11 < FFI::Struct
155
+ layout(
156
+ :display, :pointer,
157
+ :window, :ulong # /usr/include/X11/X.h
158
+ )
159
+ end
160
+
161
+ class SysWMinfo_value_x11 < FFI::Union
162
+ layout(
163
+ :x11, SysWMinfo_def_x11.by_value,
164
+ :dummy, [:uint8, 64]
165
+ )
166
+ end
167
+
168
+ class SysWMinfo_x11 < FFI::Struct
169
+ layout(
170
+ :version, Version.by_value,
171
+ :subsystem, :int,
172
+ :info, SysWMinfo_value_x11.by_value
173
+ )
174
+ end
175
+
176
+
177
+ class SysWMinfo_def_wl < FFI::Struct
178
+ layout(
179
+ :display, :pointer,
180
+ :surface, :pointer,
181
+ :shell_surface, :pointer,
182
+ :egl_window, :pointer,
183
+ :xdg_surface, :pointer,
184
+ :xdg_toplevel, :pointer,
185
+ :xdg_popup, :pointer,
186
+ :xdg_positioner, :pointer
187
+ )
188
+ end
189
+
190
+ class SysWMinfo_value_wl < FFI::Union
191
+ layout(
192
+ :wl, SysWMinfo_def_wl.by_value,
193
+ :dummy, [:uint8, 64]
194
+ )
195
+ end
196
+
197
+ class SysWMinfo_wl < FFI::Struct
198
+ layout(
199
+ :version, Version.by_value,
200
+ :subsystem, :int,
201
+ :info, SysWMinfo_value_wl.by_value
128
202
  )
129
203
  end
130
204
 
data/lib/sdl2_video.rb CHANGED
@@ -191,6 +191,7 @@ module SDL
191
191
  :SDL_SetWindowSize,
192
192
  :SDL_GetWindowSize,
193
193
  :SDL_GetWindowBordersSize,
194
+ :SDL_GetWindowSizeInPixels,
194
195
  :SDL_SetWindowMinimumSize,
195
196
  :SDL_GetWindowMinimumSize,
196
197
  :SDL_SetWindowMaximumSize,
@@ -287,6 +288,7 @@ module SDL
287
288
  :SDL_SetWindowSize => :SetWindowSize,
288
289
  :SDL_GetWindowSize => :GetWindowSize,
289
290
  :SDL_GetWindowBordersSize => :GetWindowBordersSize,
291
+ :SDL_GetWindowSizeInPixels => :GetWindowSizeInPixels,
290
292
  :SDL_SetWindowMinimumSize => :SetWindowMinimumSize,
291
293
  :SDL_GetWindowMinimumSize => :GetWindowMinimumSize,
292
294
  :SDL_SetWindowMaximumSize => :SetWindowMaximumSize,
@@ -383,6 +385,7 @@ module SDL
383
385
  :SDL_SetWindowSize => [:pointer, :int, :int],
384
386
  :SDL_GetWindowSize => [:pointer, :pointer, :pointer],
385
387
  :SDL_GetWindowBordersSize => [:pointer, :pointer, :pointer, :pointer, :pointer],
388
+ :SDL_GetWindowSizeInPixels => [:pointer, :pointer, :pointer],
386
389
  :SDL_SetWindowMinimumSize => [:pointer, :int, :int],
387
390
  :SDL_GetWindowMinimumSize => [:pointer, :pointer, :pointer],
388
391
  :SDL_SetWindowMaximumSize => [:pointer, :int, :int],
@@ -479,6 +482,7 @@ module SDL
479
482
  :SDL_SetWindowSize => :void,
480
483
  :SDL_GetWindowSize => :void,
481
484
  :SDL_GetWindowBordersSize => :int,
485
+ :SDL_GetWindowSizeInPixels => :void,
482
486
  :SDL_SetWindowMinimumSize => :void,
483
487
  :SDL_GetWindowMinimumSize => :void,
484
488
  :SDL_SetWindowMaximumSize => :void,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sdl2-bindings
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - vaiorabbit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-09 00:00:00.000000000 Z
11
+ date: 2023-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -95,14 +95,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
95
95
  requirements:
96
96
  - - ">="
97
97
  - !ruby/object:Gem::Version
98
- version: 2.6.0
98
+ version: 3.0.0
99
99
  required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  requirements: []
105
- rubygems_version: 3.3.7
105
+ rubygems_version: 3.4.1
106
106
  signing_key:
107
107
  specification_version: 4
108
108
  summary: Bindings for SDL2