sdl2-bindings 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +4 -0
- data/LICENSE.txt +1 -1
- data/README.md +3 -2
- data/lib/sdl2_audio.rb +4 -5
- data/lib/sdl2_blendmode.rb +1 -0
- data/lib/sdl2_cpuinfo.rb +5 -2
- data/lib/sdl2_events.rb +3 -2
- data/lib/sdl2_gamecontroller.rb +19 -0
- data/lib/sdl2_haptic.rb +16 -16
- data/lib/sdl2_joystick.rb +10 -4
- data/lib/sdl2_keycode.rb +1 -0
- data/lib/sdl2_log.rb +1 -0
- data/lib/sdl2_messagebox.rb +2 -0
- data/lib/sdl2_pixels.rb +6 -0
- data/lib/sdl2_render.rb +13 -0
- data/lib/sdl2_rwops.rb +11 -11
- data/lib/sdl2_stdinc.rb +50 -43
- data/lib/sdl2_version.rb +1 -1
- data/lib/sdl2_video.rb +0 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc41473b40349f4dfa868a8ad8d9dc898fe0b9f41e4e86f1a0c1b15039722efb
|
4
|
+
data.tar.gz: 41171d056bf4d1ff5c3a7f7bced34e55d7c438644fdfecc4db1295c4ce12f832
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a9371b3e04d5900aea10ce55689cfcffda6e65f882ccf043be298bf2aea79d18e0539dc0a20189253321490380cb97b25f439621062329ff04dc148b7f7a763
|
7
|
+
data.tar.gz: 3fd4acac367c289f626cd9c92f5746e08f5bf7252e59a71d56a12fb76971b063738b2bd34da9e363200757833a6310ac3eb20fa04c39a46fb770008d49a0a711
|
data/ChangeLog
CHANGED
data/LICENSE.txt
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
sdl2-bindings : Yet another SDL2 wrapper for Ruby
|
2
|
-
Copyright (c) 2015-
|
2
|
+
Copyright (c) 2015-2020 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
@@ -5,7 +5,7 @@
|
|
5
5
|
[Notice] Experimental project.
|
6
6
|
|
7
7
|
* Created : 2015-09-19
|
8
|
-
* Last modified :
|
8
|
+
* Last modified : 2020-03-22
|
9
9
|
|
10
10
|
## Features ##
|
11
11
|
|
@@ -29,13 +29,14 @@
|
|
29
29
|
* sdl2_mixer : 2.0.1
|
30
30
|
* sdl2_ttf : 2.0.13
|
31
31
|
* [2019-08-31] SDL 2.0.10 (Installed via Homebrew)
|
32
|
+
* [2020-03-22] SDL 2.0.12 (Installed via Homebrew)
|
32
33
|
|
33
34
|
## License ##
|
34
35
|
|
35
36
|
The zlib/libpng License ( http://opensource.org/licenses/Zlib ).
|
36
37
|
|
37
38
|
sdl2-bindings : Yet another SDL2 wrapper for Ruby
|
38
|
-
Copyright (c) 2015-
|
39
|
+
Copyright (c) 2015-2020 vaiorabbit <http://twitter.com/vaiorabbit>
|
39
40
|
|
40
41
|
This software is provided 'as-is', without any express or implied
|
41
42
|
warranty. In no event will the authors be held liable for any damages
|
data/lib/sdl2_audio.rb
CHANGED
@@ -10,15 +10,14 @@ module SDL2
|
|
10
10
|
extend FFI::Library
|
11
11
|
# Define/Macro
|
12
12
|
|
13
|
-
SDL_AUDIO_MASK_BITSIZE =
|
14
|
-
SDL_AUDIO_MASK_DATATYPE = (
|
15
|
-
SDL_AUDIO_MASK_ENDIAN = (
|
16
|
-
SDL_AUDIO_MASK_SIGNED = (
|
13
|
+
SDL_AUDIO_MASK_BITSIZE = 0xFF
|
14
|
+
SDL_AUDIO_MASK_DATATYPE = (1 << 8)
|
15
|
+
SDL_AUDIO_MASK_ENDIAN = (1 << 12)
|
16
|
+
SDL_AUDIO_MASK_SIGNED = (1 << 15)
|
17
17
|
SDL_AUDIO_ALLOW_FREQUENCY_CHANGE = 0x00000001
|
18
18
|
SDL_AUDIO_ALLOW_FORMAT_CHANGE = 0x00000002
|
19
19
|
SDL_AUDIO_ALLOW_CHANNELS_CHANGE = 0x00000004
|
20
20
|
SDL_AUDIO_ALLOW_SAMPLES_CHANGE = 0x00000008
|
21
|
-
SDL_AUDIO_ALLOW_ANY_CHANGE = ( SDL_AUDIO_ALLOW_FREQUENCY_CHANGE | SDL_AUDIO_ALLOW_FORMAT_CHANGE | SDL_AUDIO_ALLOW_CHANNELS_CHANGE | SDL_AUDIO_ALLOW_SAMPLES_CHANGE )
|
22
21
|
SDL_AUDIOCVT_MAX_FILTERS = 9
|
23
22
|
SDL_MIX_MAXVOLUME = 128
|
24
23
|
|
data/lib/sdl2_blendmode.rb
CHANGED
data/lib/sdl2_cpuinfo.rb
CHANGED
@@ -39,6 +39,7 @@ module SDL2
|
|
39
39
|
:SDL_HasAVX,
|
40
40
|
:SDL_HasAVX2,
|
41
41
|
:SDL_HasAVX512F,
|
42
|
+
:SDL_HasARMSIMD,
|
42
43
|
:SDL_HasNEON,
|
43
44
|
:SDL_GetSystemRAM,
|
44
45
|
:SDL_SIMDGetAlignment,
|
@@ -60,10 +61,11 @@ module SDL2
|
|
60
61
|
:SDL_HasAVX => [],
|
61
62
|
:SDL_HasAVX2 => [],
|
62
63
|
:SDL_HasAVX512F => [],
|
64
|
+
:SDL_HasARMSIMD => [],
|
63
65
|
:SDL_HasNEON => [],
|
64
66
|
:SDL_GetSystemRAM => [],
|
65
67
|
:SDL_SIMDGetAlignment => [],
|
66
|
-
:SDL_SIMDAlloc => [:
|
68
|
+
:SDL_SIMDAlloc => [:ulong],
|
67
69
|
:SDL_SIMDFree => [:pointer],
|
68
70
|
}
|
69
71
|
retvals = {
|
@@ -81,9 +83,10 @@ module SDL2
|
|
81
83
|
:SDL_HasAVX => :int,
|
82
84
|
:SDL_HasAVX2 => :int,
|
83
85
|
:SDL_HasAVX512F => :int,
|
86
|
+
:SDL_HasARMSIMD => :int,
|
84
87
|
:SDL_HasNEON => :int,
|
85
88
|
:SDL_GetSystemRAM => :int,
|
86
|
-
:SDL_SIMDGetAlignment => :
|
89
|
+
:SDL_SIMDGetAlignment => :size_t,
|
87
90
|
:SDL_SIMDAlloc => :pointer,
|
88
91
|
:SDL_SIMDFree => :void,
|
89
92
|
}
|
data/lib/sdl2_events.rb
CHANGED
@@ -13,8 +13,8 @@ module SDL2
|
|
13
13
|
|
14
14
|
SDL_RELEASED = 0
|
15
15
|
SDL_PRESSED = 1
|
16
|
-
SDL_TEXTEDITINGEVENT_TEXT_SIZE =
|
17
|
-
SDL_TEXTINPUTEVENT_TEXT_SIZE =
|
16
|
+
SDL_TEXTEDITINGEVENT_TEXT_SIZE = 32
|
17
|
+
SDL_TEXTINPUTEVENT_TEXT_SIZE = 2
|
18
18
|
SDL_QUERY = -1
|
19
19
|
SDL_IGNORE = 0
|
20
20
|
SDL_DISABLE = 0
|
@@ -311,6 +311,7 @@ module SDL2
|
|
311
311
|
:dx, :float,
|
312
312
|
:dy, :float,
|
313
313
|
:pressure, :float,
|
314
|
+
:windowID, :uint,
|
314
315
|
)
|
315
316
|
end
|
316
317
|
|
data/lib/sdl2_gamecontroller.rb
CHANGED
@@ -14,6 +14,12 @@ module SDL2
|
|
14
14
|
|
15
15
|
# Enum
|
16
16
|
|
17
|
+
SDL_CONTROLLER_TYPE_UNKNOWN = 0
|
18
|
+
SDL_CONTROLLER_TYPE_XBOX360 = 1
|
19
|
+
SDL_CONTROLLER_TYPE_XBOXONE = 2
|
20
|
+
SDL_CONTROLLER_TYPE_PS3 = 3
|
21
|
+
SDL_CONTROLLER_TYPE_PS4 = 4
|
22
|
+
SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO = 5
|
17
23
|
SDL_CONTROLLER_BINDTYPE_NONE = 0
|
18
24
|
SDL_CONTROLLER_BINDTYPE_BUTTON = 1
|
19
25
|
SDL_CONTROLLER_BINDTYPE_AXIS = 2
|
@@ -69,6 +75,7 @@ module SDL2
|
|
69
75
|
)
|
70
76
|
end
|
71
77
|
|
78
|
+
typedef :int, :SDL_GameControllerType
|
72
79
|
typedef :int, :SDL_GameControllerBindType
|
73
80
|
typedef :int, :SDL_GameControllerAxis
|
74
81
|
typedef :int, :SDL_GameControllerButton
|
@@ -88,11 +95,15 @@ module SDL2
|
|
88
95
|
:SDL_GameControllerMapping,
|
89
96
|
:SDL_IsGameController,
|
90
97
|
:SDL_GameControllerNameForIndex,
|
98
|
+
:SDL_GameControllerTypeForIndex,
|
91
99
|
:SDL_GameControllerMappingForDeviceIndex,
|
92
100
|
:SDL_GameControllerOpen,
|
93
101
|
:SDL_GameControllerFromInstanceID,
|
102
|
+
:SDL_GameControllerFromPlayerIndex,
|
94
103
|
:SDL_GameControllerName,
|
104
|
+
:SDL_GameControllerGetType,
|
95
105
|
:SDL_GameControllerGetPlayerIndex,
|
106
|
+
:SDL_GameControllerSetPlayerIndex,
|
96
107
|
:SDL_GameControllerGetVendor,
|
97
108
|
:SDL_GameControllerGetProduct,
|
98
109
|
:SDL_GameControllerGetProductVersion,
|
@@ -120,11 +131,15 @@ module SDL2
|
|
120
131
|
:SDL_GameControllerMapping => [:pointer],
|
121
132
|
:SDL_IsGameController => [:int],
|
122
133
|
:SDL_GameControllerNameForIndex => [:int],
|
134
|
+
:SDL_GameControllerTypeForIndex => [:int],
|
123
135
|
:SDL_GameControllerMappingForDeviceIndex => [:int],
|
124
136
|
:SDL_GameControllerOpen => [:int],
|
125
137
|
:SDL_GameControllerFromInstanceID => [:int],
|
138
|
+
:SDL_GameControllerFromPlayerIndex => [:int],
|
126
139
|
:SDL_GameControllerName => [:pointer],
|
140
|
+
:SDL_GameControllerGetType => [:pointer],
|
127
141
|
:SDL_GameControllerGetPlayerIndex => [:pointer],
|
142
|
+
:SDL_GameControllerSetPlayerIndex => [:pointer, :int],
|
128
143
|
:SDL_GameControllerGetVendor => [:pointer],
|
129
144
|
:SDL_GameControllerGetProduct => [:pointer],
|
130
145
|
:SDL_GameControllerGetProductVersion => [:pointer],
|
@@ -152,11 +167,15 @@ module SDL2
|
|
152
167
|
:SDL_GameControllerMapping => :pointer,
|
153
168
|
:SDL_IsGameController => :int,
|
154
169
|
:SDL_GameControllerNameForIndex => :pointer,
|
170
|
+
:SDL_GameControllerTypeForIndex => :int,
|
155
171
|
:SDL_GameControllerMappingForDeviceIndex => :pointer,
|
156
172
|
:SDL_GameControllerOpen => :pointer,
|
157
173
|
:SDL_GameControllerFromInstanceID => :pointer,
|
174
|
+
:SDL_GameControllerFromPlayerIndex => :pointer,
|
158
175
|
:SDL_GameControllerName => :pointer,
|
176
|
+
:SDL_GameControllerGetType => :int,
|
159
177
|
:SDL_GameControllerGetPlayerIndex => :int,
|
178
|
+
:SDL_GameControllerSetPlayerIndex => :void,
|
160
179
|
:SDL_GameControllerGetVendor => :ushort,
|
161
180
|
:SDL_GameControllerGetProduct => :ushort,
|
162
181
|
:SDL_GameControllerGetProductVersion => :ushort,
|
data/lib/sdl2_haptic.rb
CHANGED
@@ -10,22 +10,22 @@ module SDL2
|
|
10
10
|
extend FFI::Library
|
11
11
|
# Define/Macro
|
12
12
|
|
13
|
-
SDL_HAPTIC_CONSTANT = (
|
14
|
-
SDL_HAPTIC_SINE = (
|
15
|
-
SDL_HAPTIC_LEFTRIGHT = (
|
16
|
-
SDL_HAPTIC_TRIANGLE = (
|
17
|
-
SDL_HAPTIC_SAWTOOTHUP = (
|
18
|
-
SDL_HAPTIC_SAWTOOTHDOWN = (
|
19
|
-
SDL_HAPTIC_RAMP = (
|
20
|
-
SDL_HAPTIC_SPRING = (
|
21
|
-
SDL_HAPTIC_DAMPER = (
|
22
|
-
SDL_HAPTIC_INERTIA = (
|
23
|
-
SDL_HAPTIC_FRICTION = (
|
24
|
-
SDL_HAPTIC_CUSTOM = (
|
25
|
-
SDL_HAPTIC_GAIN = (
|
26
|
-
SDL_HAPTIC_AUTOCENTER = (
|
27
|
-
SDL_HAPTIC_STATUS = (
|
28
|
-
SDL_HAPTIC_PAUSE = (
|
13
|
+
SDL_HAPTIC_CONSTANT = (1 << 0)
|
14
|
+
SDL_HAPTIC_SINE = (1 << 1)
|
15
|
+
SDL_HAPTIC_LEFTRIGHT = (1 << 2)
|
16
|
+
SDL_HAPTIC_TRIANGLE = (1 << 3)
|
17
|
+
SDL_HAPTIC_SAWTOOTHUP = (1 << 4)
|
18
|
+
SDL_HAPTIC_SAWTOOTHDOWN = (1 << 5)
|
19
|
+
SDL_HAPTIC_RAMP = (1 << 6)
|
20
|
+
SDL_HAPTIC_SPRING = (1 << 7)
|
21
|
+
SDL_HAPTIC_DAMPER = (1 << 8)
|
22
|
+
SDL_HAPTIC_INERTIA = (1 << 9)
|
23
|
+
SDL_HAPTIC_FRICTION = (1 << 10)
|
24
|
+
SDL_HAPTIC_CUSTOM = (1 << 11)
|
25
|
+
SDL_HAPTIC_GAIN = (1 << 12)
|
26
|
+
SDL_HAPTIC_AUTOCENTER = (1 << 13)
|
27
|
+
SDL_HAPTIC_STATUS = (1 << 14)
|
28
|
+
SDL_HAPTIC_PAUSE = (1 << 15)
|
29
29
|
SDL_HAPTIC_POLAR = 0
|
30
30
|
SDL_HAPTIC_CARTESIAN = 1
|
31
31
|
SDL_HAPTIC_SPHERICAL = 2
|
data/lib/sdl2_joystick.rb
CHANGED
@@ -17,10 +17,10 @@ module SDL2
|
|
17
17
|
SDL_HAT_RIGHT = 0x02
|
18
18
|
SDL_HAT_DOWN = 0x04
|
19
19
|
SDL_HAT_LEFT = 0x08
|
20
|
-
SDL_HAT_RIGHTUP = (
|
21
|
-
SDL_HAT_RIGHTDOWN = (
|
22
|
-
SDL_HAT_LEFTUP = (
|
23
|
-
SDL_HAT_LEFTDOWN = (
|
20
|
+
SDL_HAT_RIGHTUP = (SDL_HAT_RIGHT | SDL_HAT_UP)
|
21
|
+
SDL_HAT_RIGHTDOWN = (SDL_HAT_RIGHT | SDL_HAT_DOWN)
|
22
|
+
SDL_HAT_LEFTUP = (SDL_HAT_LEFT | SDL_HAT_UP)
|
23
|
+
SDL_HAT_LEFTDOWN = (SDL_HAT_LEFT | SDL_HAT_DOWN)
|
24
24
|
|
25
25
|
# Enum
|
26
26
|
|
@@ -74,8 +74,10 @@ module SDL2
|
|
74
74
|
:SDL_JoystickGetDeviceInstanceID,
|
75
75
|
:SDL_JoystickOpen,
|
76
76
|
:SDL_JoystickFromInstanceID,
|
77
|
+
:SDL_JoystickFromPlayerIndex,
|
77
78
|
:SDL_JoystickName,
|
78
79
|
:SDL_JoystickGetPlayerIndex,
|
80
|
+
:SDL_JoystickSetPlayerIndex,
|
79
81
|
:SDL_JoystickGetGUID,
|
80
82
|
:SDL_JoystickGetVendor,
|
81
83
|
:SDL_JoystickGetProduct,
|
@@ -114,8 +116,10 @@ module SDL2
|
|
114
116
|
:SDL_JoystickGetDeviceInstanceID => [:int],
|
115
117
|
:SDL_JoystickOpen => [:int],
|
116
118
|
:SDL_JoystickFromInstanceID => [:int],
|
119
|
+
:SDL_JoystickFromPlayerIndex => [:int],
|
117
120
|
:SDL_JoystickName => [:pointer],
|
118
121
|
:SDL_JoystickGetPlayerIndex => [:pointer],
|
122
|
+
:SDL_JoystickSetPlayerIndex => [:pointer, :int],
|
119
123
|
:SDL_JoystickGetGUID => [:pointer],
|
120
124
|
:SDL_JoystickGetVendor => [:pointer],
|
121
125
|
:SDL_JoystickGetProduct => [:pointer],
|
@@ -154,8 +158,10 @@ module SDL2
|
|
154
158
|
:SDL_JoystickGetDeviceInstanceID => :int,
|
155
159
|
:SDL_JoystickOpen => :pointer,
|
156
160
|
:SDL_JoystickFromInstanceID => :pointer,
|
161
|
+
:SDL_JoystickFromPlayerIndex => :pointer,
|
157
162
|
:SDL_JoystickName => :pointer,
|
158
163
|
:SDL_JoystickGetPlayerIndex => :int,
|
164
|
+
:SDL_JoystickSetPlayerIndex => :void,
|
159
165
|
:SDL_JoystickGetGUID => SDL_JoystickGUID,
|
160
166
|
:SDL_JoystickGetVendor => :ushort,
|
161
167
|
:SDL_JoystickGetProduct => :ushort,
|
data/lib/sdl2_keycode.rb
CHANGED
data/lib/sdl2_log.rb
CHANGED
data/lib/sdl2_messagebox.rb
CHANGED
@@ -16,6 +16,8 @@ module SDL2
|
|
16
16
|
SDL_MESSAGEBOX_ERROR = 16
|
17
17
|
SDL_MESSAGEBOX_WARNING = 32
|
18
18
|
SDL_MESSAGEBOX_INFORMATION = 64
|
19
|
+
SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT = 128
|
20
|
+
SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT = 256
|
19
21
|
SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT = 1
|
20
22
|
SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = 2
|
21
23
|
SDL_MESSAGEBOX_COLOR_BACKGROUND = 0
|
data/lib/sdl2_pixels.rb
CHANGED
@@ -63,6 +63,7 @@ module SDL2
|
|
63
63
|
SDL_PIXELFORMAT_INDEX8 = 318769153
|
64
64
|
SDL_PIXELFORMAT_RGB332 = 336660481
|
65
65
|
SDL_PIXELFORMAT_RGB444 = 353504258
|
66
|
+
SDL_PIXELFORMAT_BGR444 = 357698562
|
66
67
|
SDL_PIXELFORMAT_RGB555 = 353570562
|
67
68
|
SDL_PIXELFORMAT_BGR555 = 357764866
|
68
69
|
SDL_PIXELFORMAT_ARGB4444 = 355602434
|
@@ -101,6 +102,11 @@ module SDL2
|
|
101
102
|
|
102
103
|
# Typedef
|
103
104
|
|
105
|
+
typedef :int, :SDL_PixelType
|
106
|
+
typedef :int, :SDL_BitmapOrder
|
107
|
+
typedef :int, :SDL_PackedOrder
|
108
|
+
typedef :int, :SDL_ArrayOrder
|
109
|
+
typedef :int, :SDL_PackedLayout
|
104
110
|
typedef :int, :SDL_PixelFormatEnum
|
105
111
|
|
106
112
|
# Struct
|
data/lib/sdl2_render.rb
CHANGED
@@ -17,6 +17,9 @@ module SDL2
|
|
17
17
|
SDL_RENDERER_ACCELERATED = 2
|
18
18
|
SDL_RENDERER_PRESENTVSYNC = 4
|
19
19
|
SDL_RENDERER_TARGETTEXTURE = 8
|
20
|
+
SDL_ScaleModeNearest = 0
|
21
|
+
SDL_ScaleModeLinear = 1
|
22
|
+
SDL_ScaleModeBest = 2
|
20
23
|
SDL_TEXTUREACCESS_STATIC = 0
|
21
24
|
SDL_TEXTUREACCESS_STREAMING = 1
|
22
25
|
SDL_TEXTUREACCESS_TARGET = 2
|
@@ -30,6 +33,7 @@ module SDL2
|
|
30
33
|
# Typedef
|
31
34
|
|
32
35
|
typedef :int, :SDL_RendererFlags
|
36
|
+
typedef :int, :SDL_ScaleMode
|
33
37
|
typedef :int, :SDL_TextureAccess
|
34
38
|
typedef :int, :SDL_TextureModulate
|
35
39
|
typedef :int, :SDL_RendererFlip
|
@@ -69,9 +73,12 @@ module SDL2
|
|
69
73
|
:SDL_GetTextureAlphaMod,
|
70
74
|
:SDL_SetTextureBlendMode,
|
71
75
|
:SDL_GetTextureBlendMode,
|
76
|
+
:SDL_SetTextureScaleMode,
|
77
|
+
:SDL_GetTextureScaleMode,
|
72
78
|
:SDL_UpdateTexture,
|
73
79
|
:SDL_UpdateYUVTexture,
|
74
80
|
:SDL_LockTexture,
|
81
|
+
:SDL_LockTextureToSurface,
|
75
82
|
:SDL_UnlockTexture,
|
76
83
|
:SDL_RenderTargetSupported,
|
77
84
|
:SDL_SetRenderTarget,
|
@@ -140,9 +147,12 @@ module SDL2
|
|
140
147
|
:SDL_GetTextureAlphaMod => [:pointer, :pointer],
|
141
148
|
:SDL_SetTextureBlendMode => [:pointer, :int],
|
142
149
|
:SDL_GetTextureBlendMode => [:pointer, :pointer],
|
150
|
+
:SDL_SetTextureScaleMode => [:pointer, :int],
|
151
|
+
:SDL_GetTextureScaleMode => [:pointer, :pointer],
|
143
152
|
:SDL_UpdateTexture => [:pointer, :pointer, :pointer, :int],
|
144
153
|
:SDL_UpdateYUVTexture => [:pointer, :pointer, :pointer, :int, :pointer, :int, :pointer, :int],
|
145
154
|
:SDL_LockTexture => [:pointer, :pointer, :pointer, :pointer],
|
155
|
+
:SDL_LockTextureToSurface => [:pointer, :pointer, :pointer],
|
146
156
|
:SDL_UnlockTexture => [:pointer],
|
147
157
|
:SDL_RenderTargetSupported => [:pointer],
|
148
158
|
:SDL_SetRenderTarget => [:pointer, :pointer],
|
@@ -211,9 +221,12 @@ module SDL2
|
|
211
221
|
:SDL_GetTextureAlphaMod => :int,
|
212
222
|
:SDL_SetTextureBlendMode => :int,
|
213
223
|
:SDL_GetTextureBlendMode => :int,
|
224
|
+
:SDL_SetTextureScaleMode => :int,
|
225
|
+
:SDL_GetTextureScaleMode => :int,
|
214
226
|
:SDL_UpdateTexture => :int,
|
215
227
|
:SDL_UpdateYUVTexture => :int,
|
216
228
|
:SDL_LockTexture => :int,
|
229
|
+
:SDL_LockTextureToSurface => :int,
|
217
230
|
:SDL_UnlockTexture => :void,
|
218
231
|
:SDL_RenderTargetSupported => :int,
|
219
232
|
:SDL_SetRenderTarget => :int,
|
data/lib/sdl2_rwops.rb
CHANGED
@@ -145,8 +145,8 @@ module SDL2
|
|
145
145
|
:SDL_RWsize => [:pointer],
|
146
146
|
:SDL_RWseek => [:pointer, :long_long, :int],
|
147
147
|
:SDL_RWtell => [:pointer],
|
148
|
-
:SDL_RWread => [:pointer, :pointer, :
|
149
|
-
:SDL_RWwrite => [:pointer, :pointer, :
|
148
|
+
:SDL_RWread => [:pointer, :pointer, :ulong, :ulong],
|
149
|
+
:SDL_RWwrite => [:pointer, :pointer, :ulong, :ulong],
|
150
150
|
:SDL_RWclose => [:pointer],
|
151
151
|
:SDL_LoadFile_RW => [:pointer, :pointer, :int],
|
152
152
|
:SDL_LoadFile => [:pointer, :pointer],
|
@@ -175,8 +175,8 @@ module SDL2
|
|
175
175
|
:SDL_RWsize => :long_long,
|
176
176
|
:SDL_RWseek => :long_long,
|
177
177
|
:SDL_RWtell => :long_long,
|
178
|
-
:SDL_RWread => :
|
179
|
-
:SDL_RWwrite => :
|
178
|
+
:SDL_RWread => :size_t,
|
179
|
+
:SDL_RWwrite => :size_t,
|
180
180
|
:SDL_RWclose => :int,
|
181
181
|
:SDL_LoadFile_RW => :pointer,
|
182
182
|
:SDL_LoadFile => :pointer,
|
@@ -187,13 +187,13 @@ module SDL2
|
|
187
187
|
:SDL_ReadBE32 => :uint,
|
188
188
|
:SDL_ReadLE64 => :ulong_long,
|
189
189
|
:SDL_ReadBE64 => :ulong_long,
|
190
|
-
:SDL_WriteU8 => :
|
191
|
-
:SDL_WriteLE16 => :
|
192
|
-
:SDL_WriteBE16 => :
|
193
|
-
:SDL_WriteLE32 => :
|
194
|
-
:SDL_WriteBE32 => :
|
195
|
-
:SDL_WriteLE64 => :
|
196
|
-
:SDL_WriteBE64 => :
|
190
|
+
:SDL_WriteU8 => :size_t,
|
191
|
+
:SDL_WriteLE16 => :size_t,
|
192
|
+
:SDL_WriteBE16 => :size_t,
|
193
|
+
:SDL_WriteLE32 => :size_t,
|
194
|
+
:SDL_WriteBE32 => :size_t,
|
195
|
+
:SDL_WriteLE64 => :size_t,
|
196
|
+
:SDL_WriteBE64 => :size_t,
|
197
197
|
}
|
198
198
|
symbols.each do |sym|
|
199
199
|
begin
|
data/lib/sdl2_stdinc.rb
CHANGED
@@ -18,14 +18,6 @@ module SDL2
|
|
18
18
|
|
19
19
|
# Typedef
|
20
20
|
|
21
|
-
typedef :char, :int8_t
|
22
|
-
typedef :short, :int16_t
|
23
|
-
typedef :int, :int32_t
|
24
|
-
typedef :long_long, :int64_t
|
25
|
-
typedef :uchar, :uint8_t
|
26
|
-
typedef :ushort, :uint16_t
|
27
|
-
typedef :uint, :uint32_t
|
28
|
-
typedef :ulong_long, :uint64_t
|
29
21
|
typedef :int, :SDL_bool
|
30
22
|
typedef :char, :Sint8
|
31
23
|
typedef :uchar, :Uint8
|
@@ -35,9 +27,9 @@ module SDL2
|
|
35
27
|
typedef :uint, :Uint32
|
36
28
|
typedef :long_long, :Sint64
|
37
29
|
typedef :ulong_long, :Uint64
|
38
|
-
callback :SDL_malloc_func, [:
|
39
|
-
callback :SDL_calloc_func, [:
|
40
|
-
callback :SDL_realloc_func, [:pointer, :
|
30
|
+
callback :SDL_malloc_func, [:ulong], :pointer
|
31
|
+
callback :SDL_calloc_func, [:ulong, :ulong], :pointer
|
32
|
+
callback :SDL_realloc_func, [:pointer, :ulong], :pointer
|
41
33
|
callback :SDL_free_func, [:pointer], :void
|
42
34
|
typedef :pointer, :SDL_iconv_t
|
43
35
|
|
@@ -61,6 +53,8 @@ module SDL2
|
|
61
53
|
:SDL_abs,
|
62
54
|
:SDL_isdigit,
|
63
55
|
:SDL_isspace,
|
56
|
+
:SDL_isupper,
|
57
|
+
:SDL_islower,
|
64
58
|
:SDL_toupper,
|
65
59
|
:SDL_tolower,
|
66
60
|
:SDL_memset,
|
@@ -68,11 +62,13 @@ module SDL2
|
|
68
62
|
:SDL_memcpy,
|
69
63
|
:SDL_memmove,
|
70
64
|
:SDL_memcmp,
|
71
|
-
:SDL_wcsdup,
|
72
65
|
:SDL_wcslen,
|
73
66
|
:SDL_wcslcpy,
|
74
67
|
:SDL_wcslcat,
|
68
|
+
:SDL_wcsdup,
|
69
|
+
:SDL_wcsstr,
|
75
70
|
:SDL_wcscmp,
|
71
|
+
:SDL_wcsncmp,
|
76
72
|
:SDL_strlen,
|
77
73
|
:SDL_strlcpy,
|
78
74
|
:SDL_utf8strlcpy,
|
@@ -84,6 +80,7 @@ module SDL2
|
|
84
80
|
:SDL_strchr,
|
85
81
|
:SDL_strrchr,
|
86
82
|
:SDL_strstr,
|
83
|
+
:SDL_strtokr,
|
87
84
|
:SDL_utf8strlen,
|
88
85
|
:SDL_itoa,
|
89
86
|
:SDL_uitoa,
|
@@ -149,35 +146,39 @@ module SDL2
|
|
149
146
|
:SDL_memcpy4,
|
150
147
|
]
|
151
148
|
args = {
|
152
|
-
:SDL_malloc => [:
|
153
|
-
:SDL_calloc => [:
|
154
|
-
:SDL_realloc => [:pointer, :
|
149
|
+
:SDL_malloc => [:ulong],
|
150
|
+
:SDL_calloc => [:ulong, :ulong],
|
151
|
+
:SDL_realloc => [:pointer, :ulong],
|
155
152
|
:SDL_free => [:pointer],
|
156
153
|
:SDL_GetMemoryFunctions => [:pointer, :pointer, :pointer, :pointer],
|
157
154
|
:SDL_SetMemoryFunctions => [:pointer, :pointer, :pointer, :pointer],
|
158
155
|
:SDL_GetNumAllocations => [],
|
159
156
|
:SDL_getenv => [:pointer],
|
160
157
|
:SDL_setenv => [:pointer, :pointer, :int],
|
161
|
-
:SDL_qsort => [:pointer, :
|
158
|
+
:SDL_qsort => [:pointer, :ulong, :ulong, :pointer],
|
162
159
|
:SDL_abs => [:int],
|
163
160
|
:SDL_isdigit => [:int],
|
164
161
|
:SDL_isspace => [:int],
|
162
|
+
:SDL_isupper => [:int],
|
163
|
+
:SDL_islower => [:int],
|
165
164
|
:SDL_toupper => [:int],
|
166
165
|
:SDL_tolower => [:int],
|
167
|
-
:SDL_memset => [:pointer, :int, :
|
168
|
-
:SDL_memset4 => [:pointer, :uint, :
|
169
|
-
:SDL_memcpy => [:pointer, :pointer, :
|
170
|
-
:SDL_memmove => [:pointer, :pointer, :
|
171
|
-
:SDL_memcmp => [:pointer, :pointer, :
|
172
|
-
:SDL_wcsdup => [:pointer],
|
166
|
+
:SDL_memset => [:pointer, :int, :ulong],
|
167
|
+
:SDL_memset4 => [:pointer, :uint, :ulong],
|
168
|
+
:SDL_memcpy => [:pointer, :pointer, :ulong],
|
169
|
+
:SDL_memmove => [:pointer, :pointer, :ulong],
|
170
|
+
:SDL_memcmp => [:pointer, :pointer, :ulong],
|
173
171
|
:SDL_wcslen => [:pointer],
|
174
|
-
:SDL_wcslcpy => [:pointer, :pointer, :
|
175
|
-
:SDL_wcslcat => [:pointer, :pointer, :
|
172
|
+
:SDL_wcslcpy => [:pointer, :pointer, :ulong],
|
173
|
+
:SDL_wcslcat => [:pointer, :pointer, :ulong],
|
174
|
+
:SDL_wcsdup => [:pointer],
|
175
|
+
:SDL_wcsstr => [:pointer, :pointer],
|
176
176
|
:SDL_wcscmp => [:pointer, :pointer],
|
177
|
+
:SDL_wcsncmp => [:pointer, :pointer, :ulong],
|
177
178
|
:SDL_strlen => [:pointer],
|
178
|
-
:SDL_strlcpy => [:pointer, :pointer, :
|
179
|
-
:SDL_utf8strlcpy => [:pointer, :pointer, :
|
180
|
-
:SDL_strlcat => [:pointer, :pointer, :
|
179
|
+
:SDL_strlcpy => [:pointer, :pointer, :ulong],
|
180
|
+
:SDL_utf8strlcpy => [:pointer, :pointer, :ulong],
|
181
|
+
:SDL_strlcat => [:pointer, :pointer, :ulong],
|
181
182
|
:SDL_strdup => [:pointer],
|
182
183
|
:SDL_strrev => [:pointer],
|
183
184
|
:SDL_strupr => [:pointer],
|
@@ -185,6 +186,7 @@ module SDL2
|
|
185
186
|
:SDL_strchr => [:pointer, :int],
|
186
187
|
:SDL_strrchr => [:pointer, :int],
|
187
188
|
:SDL_strstr => [:pointer, :pointer],
|
189
|
+
:SDL_strtokr => [:pointer, :pointer, :pointer],
|
188
190
|
:SDL_utf8strlen => [:pointer],
|
189
191
|
:SDL_itoa => [:int, :pointer, :int],
|
190
192
|
:SDL_uitoa => [:uint, :pointer, :int],
|
@@ -200,13 +202,13 @@ module SDL2
|
|
200
202
|
:SDL_strtoull => [:pointer, :pointer, :int],
|
201
203
|
:SDL_strtod => [:pointer, :pointer],
|
202
204
|
:SDL_strcmp => [:pointer, :pointer],
|
203
|
-
:SDL_strncmp => [:pointer, :pointer, :
|
205
|
+
:SDL_strncmp => [:pointer, :pointer, :ulong],
|
204
206
|
:SDL_strcasecmp => [:pointer, :pointer],
|
205
|
-
:SDL_strncasecmp => [:pointer, :pointer, :
|
207
|
+
:SDL_strncasecmp => [:pointer, :pointer, :ulong],
|
206
208
|
:SDL_sscanf => [:pointer, :pointer],
|
207
|
-
:SDL_vsscanf => [:pointer, :pointer, :
|
208
|
-
:SDL_snprintf => [:pointer, :
|
209
|
-
:SDL_vsnprintf => [:pointer, :
|
209
|
+
:SDL_vsscanf => [:pointer, :pointer, :pointer],
|
210
|
+
:SDL_snprintf => [:pointer, :ulong, :pointer],
|
211
|
+
:SDL_vsnprintf => [:pointer, :ulong, :pointer, :pointer],
|
210
212
|
:SDL_acos => [:double],
|
211
213
|
:SDL_acosf => [:float],
|
212
214
|
:SDL_asin => [:double],
|
@@ -246,8 +248,8 @@ module SDL2
|
|
246
248
|
:SDL_iconv_open => [:pointer, :pointer],
|
247
249
|
:SDL_iconv_close => [:pointer],
|
248
250
|
:SDL_iconv => [:pointer, :pointer, :pointer, :pointer, :pointer],
|
249
|
-
:SDL_iconv_string => [:pointer, :pointer, :pointer, :
|
250
|
-
:SDL_memcpy4 => [:pointer, :pointer, :
|
251
|
+
:SDL_iconv_string => [:pointer, :pointer, :pointer, :ulong],
|
252
|
+
:SDL_memcpy4 => [:pointer, :pointer, :ulong],
|
251
253
|
}
|
252
254
|
retvals = {
|
253
255
|
:SDL_malloc => :pointer,
|
@@ -263,6 +265,8 @@ module SDL2
|
|
263
265
|
:SDL_abs => :int,
|
264
266
|
:SDL_isdigit => :int,
|
265
267
|
:SDL_isspace => :int,
|
268
|
+
:SDL_isupper => :int,
|
269
|
+
:SDL_islower => :int,
|
266
270
|
:SDL_toupper => :int,
|
267
271
|
:SDL_tolower => :int,
|
268
272
|
:SDL_memset => :pointer,
|
@@ -270,15 +274,17 @@ module SDL2
|
|
270
274
|
:SDL_memcpy => :pointer,
|
271
275
|
:SDL_memmove => :pointer,
|
272
276
|
:SDL_memcmp => :int,
|
277
|
+
:SDL_wcslen => :size_t,
|
278
|
+
:SDL_wcslcpy => :size_t,
|
279
|
+
:SDL_wcslcat => :size_t,
|
273
280
|
:SDL_wcsdup => :pointer,
|
274
|
-
:
|
275
|
-
:SDL_wcslcpy => :int,
|
276
|
-
:SDL_wcslcat => :int,
|
281
|
+
:SDL_wcsstr => :pointer,
|
277
282
|
:SDL_wcscmp => :int,
|
278
|
-
:
|
279
|
-
:
|
280
|
-
:
|
281
|
-
:
|
283
|
+
:SDL_wcsncmp => :int,
|
284
|
+
:SDL_strlen => :size_t,
|
285
|
+
:SDL_strlcpy => :size_t,
|
286
|
+
:SDL_utf8strlcpy => :size_t,
|
287
|
+
:SDL_strlcat => :size_t,
|
282
288
|
:SDL_strdup => :pointer,
|
283
289
|
:SDL_strrev => :pointer,
|
284
290
|
:SDL_strupr => :pointer,
|
@@ -286,7 +292,8 @@ module SDL2
|
|
286
292
|
:SDL_strchr => :pointer,
|
287
293
|
:SDL_strrchr => :pointer,
|
288
294
|
:SDL_strstr => :pointer,
|
289
|
-
:
|
295
|
+
:SDL_strtokr => :pointer,
|
296
|
+
:SDL_utf8strlen => :size_t,
|
290
297
|
:SDL_itoa => :pointer,
|
291
298
|
:SDL_uitoa => :pointer,
|
292
299
|
:SDL_ltoa => :pointer,
|
@@ -346,7 +353,7 @@ module SDL2
|
|
346
353
|
:SDL_tanf => :float,
|
347
354
|
:SDL_iconv_open => :pointer,
|
348
355
|
:SDL_iconv_close => :int,
|
349
|
-
:SDL_iconv => :
|
356
|
+
:SDL_iconv => :size_t,
|
350
357
|
:SDL_iconv_string => :pointer,
|
351
358
|
:SDL_memcpy4 => :pointer,
|
352
359
|
}
|
data/lib/sdl2_version.rb
CHANGED
data/lib/sdl2_video.rb
CHANGED
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.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vaiorabbit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: 'Ruby bindings for SDL2.
|
14
14
|
|
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
84
|
requirements: []
|
85
|
-
rubygems_version: 3.
|
85
|
+
rubygems_version: 3.1.2
|
86
86
|
signing_key:
|
87
87
|
specification_version: 4
|
88
88
|
summary: Bindings for SDL2
|