Skip to content

Commit e2be038

Browse files
committed
Update bindings to 2.30.10
1 parent c21d4f8 commit e2be038

File tree

6 files changed

+99
-4
lines changed

6 files changed

+99
-4
lines changed

sdl2/events.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
"SDL_CONTROLLERDEVICEREMOVED", "SDL_CONTROLLERDEVICEREMAPPED",
5252
"SDL_CONTROLLERTOUCHPADDOWN", "SDL_CONTROLLERTOUCHPADMOTION",
5353
"SDL_CONTROLLERTOUCHPADUP", "SDL_CONTROLLERSENSORUPDATE",
54+
"SDL_CONTROLLERUPDATECOMPLETE_RESERVED_FOR_SDL3",
55+
"SDL_CONTROLLERSTEAMHANDLEUPDATED",
5456
"SDL_FINGERDOWN", "SDL_FINGERUP", "SDL_FINGERMOTION",
5557
"SDL_DOLLARGESTURE", "SDL_DOLLARRECORD", "SDL_MULTIGESTURE",
5658
"SDL_CLIPBOARDUPDATE", "SDL_DROPFILE", "SDL_DROPTEXT",
@@ -116,6 +118,8 @@
116118
SDL_CONTROLLERTOUCHPADMOTION = 0x657
117119
SDL_CONTROLLERTOUCHPADUP = 0x658
118120
SDL_CONTROLLERSENSORUPDATE = 0x659
121+
SDL_CONTROLLERUPDATECOMPLETE_RESERVED_FOR_SDL3 = 0x65A
122+
SDL_CONTROLLERSTEAMHANDLEUPDATED = 0x65B
119123
SDL_FINGERDOWN = 0x700
120124
SDL_FINGERUP = 0x701
121125
SDL_FINGERMOTION = 0x702

sdl2/gamecontroller.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_LEFT",
2727
"SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT",
2828
"SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_PAIR",
29+
"SDL_CONTROLLER_TYPE_MAX",
2930

3031
"SDL_GameControllerBindType",
3132
"SDL_CONTROLLER_BINDTYPE_NONE", "SDL_CONTROLLER_BINDTYPE_BUTTON",
@@ -80,6 +81,7 @@
8081
SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_LEFT = 11
8182
SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT = 12
8283
SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_PAIR = 13
84+
SDL_CONTROLLER_TYPE_MAX = 14
8385

8486
SDL_GameControllerAxis = c_int
8587
SDL_CONTROLLER_AXIS_INVALID = -1
@@ -173,6 +175,10 @@ class SDL_GameController(c_void_p):
173175
returns = Uint16, added = '2.23.1'
174176
),
175177
SDLFunc("SDL_GameControllerGetSerial", [_P(SDL_GameController)], c_char_p, added='2.0.14'),
178+
SDLFunc("SDL_GameControllerGetSteamHandle",
179+
[_P(SDL_GameController)],
180+
returns = Uint64, added = '2.30.0'
181+
),
176182
SDLFunc("SDL_GameControllerGetAttached", [_P(SDL_GameController)], SDL_bool),
177183
SDLFunc("SDL_GameControllerGetJoystick", [_P(SDL_GameController)], _P(SDL_Joystick)),
178184
SDLFunc("SDL_GameControllerEventState", [c_int], c_int),
@@ -320,6 +326,7 @@ class SDL_GameController(c_void_p):
320326
SDL_GameControllerGetProductVersion = _ctypes["SDL_GameControllerGetProductVersion"]
321327
SDL_GameControllerGetFirmwareVersion = _ctypes["SDL_GameControllerGetFirmwareVersion"]
322328
SDL_GameControllerGetSerial = _ctypes["SDL_GameControllerGetSerial"]
329+
SDL_GameControllerGetSteamHandle = _ctypes["SDL_GameControllerGetSteamHandle"]
323330
SDL_GameControllerNumMappings = _ctypes["SDL_GameControllerNumMappings"]
324331
SDL_GameControllerMappingForIndex = _ctypes["SDL_GameControllerMappingForIndex"]
325332
SDL_GameControllerMappingForDeviceIndex = _ctypes["SDL_GameControllerMappingForDeviceIndex"]

sdl2/hints.py

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@
4949
"SDL_HINT_IME_SUPPORT_EXTENDED_TEXT",
5050
"SDL_HINT_IOS_HIDE_HOME_INDICATOR",
5151
"SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS",
52+
"SDL_HINT_JOYSTICK_ARCADESTICK_DEVICES",
53+
"SDL_HINT_JOYSTICK_ARCADESTICK_DEVICES_EXCLUDED",
54+
"SDL_HINT_JOYSTICK_BLACKLIST_DEVICES",
55+
"SDL_HINT_JOYSTICK_BLACKLIST_DEVICES_EXCLUDED",
56+
"SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES",
57+
"SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED",
58+
"SDL_HINT_JOYSTICK_GAMECUBE_DEVICES",
59+
"SDL_HINT_JOYSTICK_GAMECUBE_DEVICES_EXCLUDED",
5260
"SDL_HINT_JOYSTICK_HIDAPI",
5361
"SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE",
5462
"SDL_HINT_JOYSTICK_GAMECUBE_RUMBLE_BRAKE",
@@ -66,6 +74,7 @@
6674
"SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE",
6775
"SDL_HINT_JOYSTICK_HIDAPI_STADIA",
6876
"SDL_HINT_JOYSTICK_HIDAPI_STEAM",
77+
"SDL_HINT_JOYSTICK_HIDAPI_STEAMDECK",
6978
"SDL_HINT_JOYSTICK_HIDAPI_SWITCH",
7079
"SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED",
7180
"SDL_HINT_JOYSTICK_HIDAPI_JOYCON_HOME_LED",
@@ -78,18 +87,26 @@
7887
"SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS",
7988
"SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE",
8089
"SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED",
90+
"SDL_HINT_JOYSTICK_IOKIT",
91+
"SDL_HINT_JOYSTICK_MFI",
8192
"SDL_HINT_JOYSTICK_RAWINPUT",
8293
"SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT",
8394
"SDL_HINT_JOYSTICK_HIDAPI_CORRELATE_XINPUT",
8495
"SDL_HINT_JOYSTICK_ROG_CHAKRAM",
8596
"SDL_HINT_JOYSTICK_THREAD",
97+
"SDL_HINT_JOYSTICK_THROTTLE_DEVICES",
98+
"SDL_HINT_JOYSTICK_THROTTLE_DEVICES_EXCLUDED",
8699
"SDL_HINT_JOYSTICK_WGI",
100+
"SDL_HINT_JOYSTICK_WHEEL_DEVICES",
101+
"SDL_HINT_JOYSTICK_WHEEL_DEVICES_EXCLUDED",
102+
"SDL_HINT_JOYSTICK_ZERO_CENTERED_DEVICES",
87103
"SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER",
88104
"SDL_HINT_JOYSTICK_DEVICE",
89105
"SDL_HINT_LINUX_DIGITAL_HATS",
90106
"SDL_HINT_LINUX_HAT_DEADZONES",
91107
"SDL_HINT_LINUX_JOYSTICK_CLASSIC",
92108
"SDL_HINT_LINUX_JOYSTICK_DEADZONES",
109+
"SDL_HINT_LOGGING",
93110
"SDL_HINT_MAC_BACKGROUND_APP",
94111
"SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK",
95112
"SDL_HINT_MAC_OPENGL_ASYNC_DISPATCH",
@@ -103,6 +120,7 @@
103120
"SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE",
104121
"SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE",
105122
"SDL_HINT_MOUSE_RELATIVE_WARP_MOTION",
123+
"SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE",
106124
"SDL_HINT_MOUSE_TOUCH_EVENTS",
107125
"SDL_HINT_MOUSE_AUTO_CAPTURE",
108126
"SDL_HINT_NO_SIGNAL_HANDLERS",
@@ -122,6 +140,8 @@
122140
"SDL_HINT_RENDER_SCALE_QUALITY",
123141
"SDL_HINT_RENDER_VSYNC",
124142
"SDL_HINT_RENDER_METAL_PREFER_LOW_POWER_DEVICE",
143+
"SDL_HINT_ROG_GAMEPAD_MICE",
144+
"SDL_HINT_ROG_GAMEPAD_MICE_EXCLUDED",
125145
"SDL_HINT_PS2_DYNAMIC_VSYNC",
126146
"SDL_HINT_RETURN_KEY_HIDES_IME",
127147
"SDL_HINT_RPI_VIDEO_LAYER",
@@ -155,7 +175,7 @@
155175
"SDL_HINT_VIDEO_X11_XINERAMA",
156176
"SDL_HINT_VIDEO_X11_XRANDR",
157177
"SDL_HINT_VIDEO_X11_XVIDMODE",
158-
"SDL_HINT_WAVE_FACT_CHUNK",
178+
"SDL_HINT_WAVE_FACT_CHUNK",
159179
"SDL_HINT_WAVE_RIFF_CHUNK_SIZE",
160180
"SDL_HINT_WAVE_TRUNCATION",
161181
"SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING",
@@ -176,12 +196,16 @@
176196
"SDL_HINT_WINRT_PRIVACY_POLICY_URL",
177197
"SDL_HINT_X11_FORCE_OVERRIDE_REDIRECT",
178198
"SDL_HINT_XINPUT_ENABLED",
199+
"SDL_HINT_DIRECTINPUT_ENABLED",
179200
"SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING",
180201
"SDL_HINT_AUDIO_INCLUDE_MONITORS",
181202
"SDL_HINT_X11_WINDOW_TYPE",
182203
"SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE",
183204
"SDL_HINT_VIDEODRIVER",
184205
"SDL_HINT_AUDIODRIVER",
206+
"SDL_HINT_KMSDRM_DEVICE_INDEX",
207+
"SDL_HINT_TRACKPAD_IS_TOUCH_ONLY",
208+
"SDL_HINT_SHUTDOWN_DBUS_ON_QUIT",
185209

186210
# Enums
187211
"SDL_HintPriority",
@@ -197,6 +221,7 @@
197221
SDL_HINT_APP_NAME = b"SDL_APP_NAME"
198222
SDL_HINT_BMP_SAVE_LEGACY_FORMAT = b"SDL_BMP_SAVE_LEGACY_FORMAT"
199223
SDL_HINT_EVENT_LOGGING = b"SDL_EVENT_LOGGING"
224+
SDL_HINT_LOGGING = b"SDL_LOGGING"
200225
SDL_HINT_NO_SIGNAL_HANDLERS = b"SDL_NO_SIGNAL_HANDLERS"
201226
SDL_HINT_POLL_SENTINEL = b"SDL_POLL_SENTINEL"
202227
SDL_HINT_PREFERRED_LOCALES = b"SDL_PREFERRED_LOCALES"
@@ -282,14 +307,18 @@
282307
SDL_HINT_MOUSE_DOUBLE_CLICK_TIME = b"SDL_MOUSE_DOUBLE_CLICK_TIME"
283308
SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH = b"SDL_MOUSE_FOCUS_CLICKTHROUGH"
284309
SDL_HINT_MOUSE_NORMAL_SPEED_SCALE = b"SDL_MOUSE_NORMAL_SPEED_SCALE"
310+
SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE = b"SDL_MOUSE_RELATIVE_CURSOR_VISIBLE"
285311
SDL_HINT_MOUSE_RELATIVE_MODE_CENTER = b"SDL_MOUSE_RELATIVE_MODE_CENTER"
286312
SDL_HINT_MOUSE_RELATIVE_MODE_WARP = b"SDL_MOUSE_RELATIVE_MODE_WARP"
287313
SDL_HINT_MOUSE_RELATIVE_SCALING = b"SDL_MOUSE_RELATIVE_SCALING"
288314
SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE = b"SDL_MOUSE_RELATIVE_SPEED_SCALE"
289315
SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE = b"SDL_MOUSE_RELATIVE_SYSTEM_SCALE"
290316
SDL_HINT_MOUSE_RELATIVE_WARP_MOTION = b"SDL_MOUSE_RELATIVE_WARP_MOTION"
291317
SDL_HINT_MOUSE_TOUCH_EVENTS = b"SDL_MOUSE_TOUCH_EVENTS"
318+
SDL_HINT_ROG_GAMEPAD_MICE = b"SDL_ROG_GAMEPAD_MICE"
319+
SDL_HINT_ROG_GAMEPAD_MICE_EXCLUDED = b"SDL_ROG_GAMEPAD_MICE_EXCLUDED"
292320
SDL_HINT_TOUCH_MOUSE_EVENTS = b"SDL_TOUCH_MOUSE_EVENTS"
321+
SDL_HINT_TRACKPAD_IS_TOUCH_ONLY = b"SDL_TRACKPAD_IS_TOUCH_ONLY"
293322

294323

295324
# Joystick & Gamepad Hints
@@ -305,6 +334,14 @@
305334
SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS = b"SDL_GAMECONTROLLER_USE_BUTTON_LABELS"
306335
SDL_HINT_HIDAPI_IGNORE_DEVICES = b"SDL_HIDAPI_IGNORE_DEVICES"
307336
SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS = b"SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS"
337+
SDL_HINT_JOYSTICK_ARCADESTICK_DEVICES = b"SDL_JOYSTICK_ARCADESTICK_DEVICES"
338+
SDL_HINT_JOYSTICK_ARCADESTICK_DEVICES_EXCLUDED = b"SDL_JOYSTICK_ARCADESTICK_DEVICES_EXCLUDED"
339+
SDL_HINT_JOYSTICK_BLACKLIST_DEVICES = b"SDL_JOYSTICK_BLACKLIST_DEVICES"
340+
SDL_HINT_JOYSTICK_BLACKLIST_DEVICES_EXCLUDED = b"SDL_JOYSTICK_BLACKLIST_DEVICES_EXCLUDED"
341+
SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES = b"SDL_JOYSTICK_FLIGHTSTICK_DEVICES"
342+
SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED = b"SDL_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED"
343+
SDL_HINT_JOYSTICK_GAMECUBE_DEVICES = b"SDL_JOYSTICK_GAMECUBE_DEVICES"
344+
SDL_HINT_JOYSTICK_GAMECUBE_DEVICES_EXCLUDED = b"SDL_JOYSTICK_GAMECUBE_DEVICES_EXCLUDED"
308345
SDL_HINT_JOYSTICK_HIDAPI = b"SDL_JOYSTICK_HIDAPI"
309346
SDL_HINT_JOYSTICK_HIDAPI_CORRELATE_XINPUT = b"SDL_JOYSTICK_HIDAPI_CORRELATE_XINPUT"
310347
SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE = b"SDL_JOYSTICK_HIDAPI_GAMECUBE"
@@ -324,6 +361,7 @@
324361
SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE = b"SDL_JOYSTICK_HIDAPI_PS5_RUMBLE"
325362
SDL_HINT_JOYSTICK_HIDAPI_STADIA = b"SDL_JOYSTICK_HIDAPI_STADIA"
326363
SDL_HINT_JOYSTICK_HIDAPI_STEAM = b"SDL_JOYSTICK_HIDAPI_STEAM"
364+
SDL_HINT_JOYSTICK_HIDAPI_STEAMDECK = b"SDL_JOYSTICK_HIDAPI_STEAMDECK"
327365
SDL_HINT_JOYSTICK_HIDAPI_SWITCH = b"SDL_JOYSTICK_HIDAPI_SWITCH"
328366
SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED = b"SDL_JOYSTICK_HIDAPI_SWITCH_HOME_LED"
329367
SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED = b"SDL_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED"
@@ -339,14 +377,22 @@
339377
SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT = b"SDL_JOYSTICK_RAWINPUT_CORRELATE_XINPUT"
340378
SDL_HINT_JOYSTICK_ROG_CHAKRAM = b"SDL_JOYSTICK_ROG_CHAKRAM"
341379
SDL_HINT_JOYSTICK_THREAD = b"SDL_JOYSTICK_THREAD"
380+
SDL_HINT_JOYSTICK_THROTTLE_DEVICES = b"SDL_JOYSTICK_THROTTLE_DEVICES"
381+
SDL_HINT_JOYSTICK_THROTTLE_DEVICES_EXCLUDED = b"SDL_JOYSTICK_THROTTLE_DEVICES_EXCLUDED"
342382
SDL_HINT_JOYSTICK_WGI = b"SDL_JOYSTICK_WGI"
383+
SDL_HINT_JOYSTICK_WHEEL_DEVICES = b"SDL_JOYSTICK_WHEEL_DEVICES"
384+
SDL_HINT_JOYSTICK_WHEEL_DEVICES_EXCLUDED = b"SDL_JOYSTICK_WHEEL_DEVICES_EXCLUDED"
343385
SDL_HINT_JOYSTICK_DEVICE = b"SDL_JOYSTICK_DEVICE"
386+
SDL_HINT_JOYSTICK_ZERO_CENTERED_DEVICES = b"SDL_JOYSTICK_ZERO_CENTERED_DEVICES"
344387

345388

346389
# Platform Specific Hints
347390

391+
SDL_HINT_DIRECTINPUT_ENABLED = b"SDL_DIRECTINPUT_ENABLED"
348392
SDL_HINT_EMSCRIPTEN_ASYNCIFY = b"SDL_EMSCRIPTEN_ASYNCIFY"
349393
SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT = b"SDL_EMSCRIPTEN_KEYBOARD_ELEMENT"
394+
SDL_HINT_JOYSTICK_IOKIT = b"SDL_JOYSTICK_IOKIT"
395+
SDL_HINT_KMSDRM_DEVICE_INDEX = b"SDL_KMSDRM_DEVICE_INDEX"
350396
SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER = b"SDL_KMSDRM_REQUIRE_DRM_MASTER"
351397
SDL_HINT_LINUX_DIGITAL_HATS = b"SDL_LINUX_DIGITAL_HATS"
352398
SDL_HINT_LINUX_HAT_DEADZONES = b"SDL_LINUX_HAT_DEADZONES"
@@ -359,6 +405,7 @@
359405
SDL_HINT_RPI_VIDEO_LAYER = b"SDL_RPI_VIDEO_LAYER"
360406
SDL_HINT_RENDER_DIRECT3D11_DEBUG = b"SDL_RENDER_DIRECT3D11_DEBUG"
361407
SDL_HINT_RENDER_DIRECT3D_THREADSAFE = b"SDL_RENDER_DIRECT3D_THREADSAFE"
408+
SDL_HINT_SHUTDOWN_DBUS_ON_QUIT = b"SDL_SHUTDOWN_DBUS_ON_QUIT"
362409
SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES = b"SDL_VIDEO_MAC_FULLSCREEN_SPACES"
363410
SDL_HINT_VIDEO_WIN_D3DCOMPILER = b"SDL_VIDEO_WIN_D3DCOMPILER"
364411
SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 = b"SDL_WINDOWS_NO_CLOSE_ON_ALT_F4"
@@ -393,6 +440,7 @@
393440
SDL_HINT_ENABLE_SCREEN_KEYBOARD = b"SDL_ENABLE_SCREEN_KEYBOARD"
394441
SDL_HINT_IDLE_TIMER_DISABLED = b"SDL_IOS_IDLE_TIMER_DISABLED"
395442
SDL_HINT_IOS_HIDE_HOME_INDICATOR = "SDL_IOS_HIDE_HOME_INDICATOR"
443+
SDL_HINT_JOYSTICK_MFI = b"SDL_JOYSTICK_MFI"
396444
SDL_HINT_VITA_TOUCH_MOUSE_DEVICE = b"SDL_HINT_VITA_TOUCH_MOUSE_DEVICE"
397445
SDL_HINT_WINRT_PRIVACY_POLICY_URL = b"SDL_WINRT_PRIVACY_POLICY_URL"
398446
SDL_HINT_WINRT_PRIVACY_POLICY_LABEL = b"SDL_WINRT_PRIVACY_POLICY_LABEL"

sdl2/pixels.py

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"SDL_PIXELTYPE_INDEX1", "SDL_PIXELTYPE_INDEX4", "SDL_PIXELTYPE_INDEX8",
1616
"SDL_PIXELTYPE_PACKED8", "SDL_PIXELTYPE_PACKED16", "SDL_PIXELTYPE_PACKED32",
1717
"SDL_PIXELTYPE_ARRAYU8", "SDL_PIXELTYPE_ARRAYU16", "SDL_PIXELTYPE_ARRAYU32",
18-
"SDL_PIXELTYPE_ARRAYF16", "SDL_PIXELTYPE_ARRAYF32",
18+
"SDL_PIXELTYPE_ARRAYF16", "SDL_PIXELTYPE_ARRAYF32", "SDL_PIXELTYPE_INDEX2",
1919

2020
"SDL_BitmapOrder",
2121
"SDL_BITMAPORDER_NONE", "SDL_BITMAPORDER_4321", "SDL_BITMAPORDER_1234",
@@ -41,6 +41,7 @@
4141
"SDL_PixelFormatEnum",
4242
"SDL_PIXELFORMAT_UNKNOWN",
4343
"SDL_PIXELFORMAT_INDEX1LSB", "SDL_PIXELFORMAT_INDEX1MSB",
44+
"SDL_PIXELFORMAT_INDEX2LSB", "SDL_PIXELFORMAT_INDEX2MSB",
4445
"SDL_PIXELFORMAT_INDEX4LSB", "SDL_PIXELFORMAT_INDEX4MSB",
4546
"SDL_PIXELFORMAT_INDEX8",
4647
"SDL_PIXELFORMAT_RGB332",
@@ -62,6 +63,8 @@
6263
"SDL_PIXELFORMAT_ARGB2101010",
6364
"SDL_PIXELFORMAT_RGBA32", "SDL_PIXELFORMAT_ARGB32",
6465
"SDL_PIXELFORMAT_BGRA32", "SDL_PIXELFORMAT_ABGR32",
66+
"SDL_PIXELFORMAT_RGBX32", "SDL_PIXELFORMAT_XRGB32",
67+
"SDL_PIXELFORMAT_BGRX32", "SDL_PIXELFORMAT_XBGR32",
6568
"SDL_PIXELFORMAT_YV12", "SDL_PIXELFORMAT_IYUV", "SDL_PIXELFORMAT_YUY2",
6669
"SDL_PIXELFORMAT_UYVY", "SDL_PIXELFORMAT_YVYU",
6770
"SDL_PIXELFORMAT_NV12", "SDL_PIXELFORMAT_NV21",
@@ -100,6 +103,7 @@
100103
SDL_PIXELTYPE_ARRAYU32 = 9
101104
SDL_PIXELTYPE_ARRAYF16 = 10
102105
SDL_PIXELTYPE_ARRAYF32 = 11
106+
SDL_PIXELTYPE_INDEX2 = 12
103107

104108
SDL_BitmapOrder = c_int
105109
SDL_BITMAPORDER_NONE = 0
@@ -172,6 +176,7 @@ def SDL_ISPIXELFORMAT_INDEXED(pformat):
172176
return (
173177
SDL_ISPIXELFORMAT_FOURCC(pformat) == False and (
174178
(SDL_PIXELTYPE(pformat) == SDL_PIXELTYPE_INDEX1) or
179+
(SDL_PIXELTYPE(pformat) == SDL_PIXELTYPE_INDEX2) or
175180
(SDL_PIXELTYPE(pformat) == SDL_PIXELTYPE_INDEX4) or
176181
(SDL_PIXELTYPE(pformat) == SDL_PIXELTYPE_INDEX8)
177182
))
@@ -229,6 +234,16 @@ def SDL_ISPIXELFORMAT_ALPHA(pformat):
229234
SDL_BITMAPORDER_1234,
230235
0, 1, 0
231236
)
237+
SDL_PIXELFORMAT_INDEX2LSB = SDL_DEFINE_PIXELFORMAT(
238+
SDL_PIXELTYPE_INDEX2,
239+
SDL_BITMAPORDER_4321,
240+
0, 2, 0
241+
)
242+
SDL_PIXELFORMAT_INDEX2MSB = SDL_DEFINE_PIXELFORMAT(
243+
SDL_PIXELTYPE_INDEX2,
244+
SDL_BITMAPORDER_1234,
245+
0, 2, 0
246+
)
232247
SDL_PIXELFORMAT_INDEX4LSB = SDL_DEFINE_PIXELFORMAT(
233248
SDL_PIXELTYPE_INDEX4,
234249
SDL_BITMAPORDER_4321,
@@ -384,11 +399,19 @@ def SDL_ISPIXELFORMAT_ALPHA(pformat):
384399
SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_ARGB8888
385400
SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_BGRA8888
386401
SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_ABGR8888
402+
SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_RGBX8888
403+
SDL_PIXELFORMAT_XRGB32 = SDL_PIXELFORMAT_XRGB8888
404+
SDL_PIXELFORMAT_BGRX32 = SDL_PIXELFORMAT_BGRX8888
405+
SDL_PIXELFORMAT_XBGR32 = SDL_PIXELFORMAT_XBGR8888
387406
else:
388407
SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_ABGR8888
389408
SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_BGRA8888
390409
SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_ARGB8888
391410
SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_RGBA8888
411+
SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_XBGR8888
412+
SDL_PIXELFORMAT_XRGB32 = SDL_PIXELFORMAT_BGRX8888
413+
SDL_PIXELFORMAT_BGRX32 = SDL_PIXELFORMAT_XRGB8888
414+
SDL_PIXELFORMAT_XBGR32 = SDL_PIXELFORMAT_RGBX8888
392415
SDL_PIXELFORMAT_YV12 = SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2')
393416
SDL_PIXELFORMAT_IYUV = SDL_DEFINE_PIXELFOURCC('I', 'Y', 'U', 'V')
394417
SDL_PIXELFORMAT_YUY2 = SDL_DEFINE_PIXELFOURCC('Y', 'U', 'Y', '2')
@@ -444,6 +467,13 @@ def SDL_ISPIXELFORMAT_ALPHA(pformat):
444467
}
445468
if sdl_version >= 2012:
446469
NAME_MAP['BGR444'] = SDL_PIXELFORMAT_BGR444
470+
if sdl_version >= 2300:
471+
NAME_MAP['INDEX2LSB'] = SDL_PIXELFORMAT_INDEX2LSB
472+
NAME_MAP['INDEX2MSB'] = SDL_PIXELFORMAT_INDEX2MSB
473+
NAME_MAP['RGBX32'] = SDL_PIXELFORMAT_RGBX32
474+
NAME_MAP['XRGB32'] = SDL_PIXELFORMAT_XRGB32
475+
NAME_MAP['BGRX32'] = SDL_PIXELFORMAT_BGRX32
476+
NAME_MAP['XBGR32'] = SDL_PIXELFORMAT_XBGR32
447477
ALL_PIXELFORMATS = tuple(NAME_MAP.values())
448478

449479

sdl2/test/gamecontroller_test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,12 @@ def test_SDL_GameControllerGetSerial(gamepads):
268268
serial = sdl2.SDL_GameControllerGetSerial(pad)
269269
assert serial == None or type(serial) in (str, bytes)
270270

271+
@pytest.mark.skipif(sdl2.dll.version < 2300, reason="not available")
272+
def test_SDL_GameControllerGetSteamHandle(gamepads):
273+
for pad in gamepads:
274+
handle = sdl2.SDL_GameControllerGetSteamHandle(pad)
275+
assert handle >= 0
276+
271277
def test_SDL_GameControllerGetAttached(gamepads):
272278
for pad in gamepads:
273279
ret = sdl2.SDL_GameControllerGetAttached(pad)

sdl2/version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
# Constants, enums, & macros
2020

2121
SDL_MAJOR_VERSION = 2
22-
SDL_MINOR_VERSION = 28
23-
SDL_PATCHLEVEL = 5
22+
SDL_MINOR_VERSION = 30
23+
SDL_PATCHLEVEL = 10
2424

2525
def SDL_VERSION(x):
2626
x.major = SDL_MAJOR_VERSION

0 commit comments

Comments
 (0)