From e2be03859b7723b97cc182842584cb7b30f5caab Mon Sep 17 00:00:00 2001 From: Austin Hurst Date: Tue, 10 Dec 2024 19:37:02 -0400 Subject: [PATCH 1/8] Update bindings to 2.30.10 --- sdl2/events.py | 4 +++ sdl2/gamecontroller.py | 7 +++++ sdl2/hints.py | 50 +++++++++++++++++++++++++++++++- sdl2/pixels.py | 32 +++++++++++++++++++- sdl2/test/gamecontroller_test.py | 6 ++++ sdl2/version.py | 4 +-- 6 files changed, 99 insertions(+), 4 deletions(-) diff --git a/sdl2/events.py b/sdl2/events.py index 5364dfce..78ee77a3 100644 --- a/sdl2/events.py +++ b/sdl2/events.py @@ -51,6 +51,8 @@ "SDL_CONTROLLERDEVICEREMOVED", "SDL_CONTROLLERDEVICEREMAPPED", "SDL_CONTROLLERTOUCHPADDOWN", "SDL_CONTROLLERTOUCHPADMOTION", "SDL_CONTROLLERTOUCHPADUP", "SDL_CONTROLLERSENSORUPDATE", + "SDL_CONTROLLERUPDATECOMPLETE_RESERVED_FOR_SDL3", + "SDL_CONTROLLERSTEAMHANDLEUPDATED", "SDL_FINGERDOWN", "SDL_FINGERUP", "SDL_FINGERMOTION", "SDL_DOLLARGESTURE", "SDL_DOLLARRECORD", "SDL_MULTIGESTURE", "SDL_CLIPBOARDUPDATE", "SDL_DROPFILE", "SDL_DROPTEXT", @@ -116,6 +118,8 @@ SDL_CONTROLLERTOUCHPADMOTION = 0x657 SDL_CONTROLLERTOUCHPADUP = 0x658 SDL_CONTROLLERSENSORUPDATE = 0x659 +SDL_CONTROLLERUPDATECOMPLETE_RESERVED_FOR_SDL3 = 0x65A +SDL_CONTROLLERSTEAMHANDLEUPDATED = 0x65B SDL_FINGERDOWN = 0x700 SDL_FINGERUP = 0x701 SDL_FINGERMOTION = 0x702 diff --git a/sdl2/gamecontroller.py b/sdl2/gamecontroller.py index 10a33fed..53d3b67d 100644 --- a/sdl2/gamecontroller.py +++ b/sdl2/gamecontroller.py @@ -26,6 +26,7 @@ "SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_LEFT", "SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT", "SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_PAIR", + "SDL_CONTROLLER_TYPE_MAX", "SDL_GameControllerBindType", "SDL_CONTROLLER_BINDTYPE_NONE", "SDL_CONTROLLER_BINDTYPE_BUTTON", @@ -80,6 +81,7 @@ SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_LEFT = 11 SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT = 12 SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_PAIR = 13 +SDL_CONTROLLER_TYPE_MAX = 14 SDL_GameControllerAxis = c_int SDL_CONTROLLER_AXIS_INVALID = -1 @@ -173,6 +175,10 @@ class SDL_GameController(c_void_p): returns = Uint16, added = '2.23.1' ), SDLFunc("SDL_GameControllerGetSerial", [_P(SDL_GameController)], c_char_p, added='2.0.14'), + SDLFunc("SDL_GameControllerGetSteamHandle", + [_P(SDL_GameController)], + returns = Uint64, added = '2.30.0' + ), SDLFunc("SDL_GameControllerGetAttached", [_P(SDL_GameController)], SDL_bool), SDLFunc("SDL_GameControllerGetJoystick", [_P(SDL_GameController)], _P(SDL_Joystick)), SDLFunc("SDL_GameControllerEventState", [c_int], c_int), @@ -320,6 +326,7 @@ class SDL_GameController(c_void_p): SDL_GameControllerGetProductVersion = _ctypes["SDL_GameControllerGetProductVersion"] SDL_GameControllerGetFirmwareVersion = _ctypes["SDL_GameControllerGetFirmwareVersion"] SDL_GameControllerGetSerial = _ctypes["SDL_GameControllerGetSerial"] +SDL_GameControllerGetSteamHandle = _ctypes["SDL_GameControllerGetSteamHandle"] SDL_GameControllerNumMappings = _ctypes["SDL_GameControllerNumMappings"] SDL_GameControllerMappingForIndex = _ctypes["SDL_GameControllerMappingForIndex"] SDL_GameControllerMappingForDeviceIndex = _ctypes["SDL_GameControllerMappingForDeviceIndex"] diff --git a/sdl2/hints.py b/sdl2/hints.py index 1ff3af9b..1c86b663 100644 --- a/sdl2/hints.py +++ b/sdl2/hints.py @@ -49,6 +49,14 @@ "SDL_HINT_IME_SUPPORT_EXTENDED_TEXT", "SDL_HINT_IOS_HIDE_HOME_INDICATOR", "SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS", + "SDL_HINT_JOYSTICK_ARCADESTICK_DEVICES", + "SDL_HINT_JOYSTICK_ARCADESTICK_DEVICES_EXCLUDED", + "SDL_HINT_JOYSTICK_BLACKLIST_DEVICES", + "SDL_HINT_JOYSTICK_BLACKLIST_DEVICES_EXCLUDED", + "SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES", + "SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED", + "SDL_HINT_JOYSTICK_GAMECUBE_DEVICES", + "SDL_HINT_JOYSTICK_GAMECUBE_DEVICES_EXCLUDED", "SDL_HINT_JOYSTICK_HIDAPI", "SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE", "SDL_HINT_JOYSTICK_GAMECUBE_RUMBLE_BRAKE", @@ -66,6 +74,7 @@ "SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE", "SDL_HINT_JOYSTICK_HIDAPI_STADIA", "SDL_HINT_JOYSTICK_HIDAPI_STEAM", + "SDL_HINT_JOYSTICK_HIDAPI_STEAMDECK", "SDL_HINT_JOYSTICK_HIDAPI_SWITCH", "SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED", "SDL_HINT_JOYSTICK_HIDAPI_JOYCON_HOME_LED", @@ -78,18 +87,26 @@ "SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS", "SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE", "SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED", + "SDL_HINT_JOYSTICK_IOKIT", + "SDL_HINT_JOYSTICK_MFI", "SDL_HINT_JOYSTICK_RAWINPUT", "SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT", "SDL_HINT_JOYSTICK_HIDAPI_CORRELATE_XINPUT", "SDL_HINT_JOYSTICK_ROG_CHAKRAM", "SDL_HINT_JOYSTICK_THREAD", + "SDL_HINT_JOYSTICK_THROTTLE_DEVICES", + "SDL_HINT_JOYSTICK_THROTTLE_DEVICES_EXCLUDED", "SDL_HINT_JOYSTICK_WGI", + "SDL_HINT_JOYSTICK_WHEEL_DEVICES", + "SDL_HINT_JOYSTICK_WHEEL_DEVICES_EXCLUDED", + "SDL_HINT_JOYSTICK_ZERO_CENTERED_DEVICES", "SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER", "SDL_HINT_JOYSTICK_DEVICE", "SDL_HINT_LINUX_DIGITAL_HATS", "SDL_HINT_LINUX_HAT_DEADZONES", "SDL_HINT_LINUX_JOYSTICK_CLASSIC", "SDL_HINT_LINUX_JOYSTICK_DEADZONES", + "SDL_HINT_LOGGING", "SDL_HINT_MAC_BACKGROUND_APP", "SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK", "SDL_HINT_MAC_OPENGL_ASYNC_DISPATCH", @@ -103,6 +120,7 @@ "SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE", "SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE", "SDL_HINT_MOUSE_RELATIVE_WARP_MOTION", + "SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE", "SDL_HINT_MOUSE_TOUCH_EVENTS", "SDL_HINT_MOUSE_AUTO_CAPTURE", "SDL_HINT_NO_SIGNAL_HANDLERS", @@ -122,6 +140,8 @@ "SDL_HINT_RENDER_SCALE_QUALITY", "SDL_HINT_RENDER_VSYNC", "SDL_HINT_RENDER_METAL_PREFER_LOW_POWER_DEVICE", + "SDL_HINT_ROG_GAMEPAD_MICE", + "SDL_HINT_ROG_GAMEPAD_MICE_EXCLUDED", "SDL_HINT_PS2_DYNAMIC_VSYNC", "SDL_HINT_RETURN_KEY_HIDES_IME", "SDL_HINT_RPI_VIDEO_LAYER", @@ -155,7 +175,7 @@ "SDL_HINT_VIDEO_X11_XINERAMA", "SDL_HINT_VIDEO_X11_XRANDR", "SDL_HINT_VIDEO_X11_XVIDMODE", - "SDL_HINT_WAVE_FACT_CHUNK", + "SDL_HINT_WAVE_FACT_CHUNK", "SDL_HINT_WAVE_RIFF_CHUNK_SIZE", "SDL_HINT_WAVE_TRUNCATION", "SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING", @@ -176,12 +196,16 @@ "SDL_HINT_WINRT_PRIVACY_POLICY_URL", "SDL_HINT_X11_FORCE_OVERRIDE_REDIRECT", "SDL_HINT_XINPUT_ENABLED", + "SDL_HINT_DIRECTINPUT_ENABLED", "SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING", "SDL_HINT_AUDIO_INCLUDE_MONITORS", "SDL_HINT_X11_WINDOW_TYPE", "SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE", "SDL_HINT_VIDEODRIVER", "SDL_HINT_AUDIODRIVER", + "SDL_HINT_KMSDRM_DEVICE_INDEX", + "SDL_HINT_TRACKPAD_IS_TOUCH_ONLY", + "SDL_HINT_SHUTDOWN_DBUS_ON_QUIT", # Enums "SDL_HintPriority", @@ -197,6 +221,7 @@ SDL_HINT_APP_NAME = b"SDL_APP_NAME" SDL_HINT_BMP_SAVE_LEGACY_FORMAT = b"SDL_BMP_SAVE_LEGACY_FORMAT" SDL_HINT_EVENT_LOGGING = b"SDL_EVENT_LOGGING" +SDL_HINT_LOGGING = b"SDL_LOGGING" SDL_HINT_NO_SIGNAL_HANDLERS = b"SDL_NO_SIGNAL_HANDLERS" SDL_HINT_POLL_SENTINEL = b"SDL_POLL_SENTINEL" SDL_HINT_PREFERRED_LOCALES = b"SDL_PREFERRED_LOCALES" @@ -282,6 +307,7 @@ SDL_HINT_MOUSE_DOUBLE_CLICK_TIME = b"SDL_MOUSE_DOUBLE_CLICK_TIME" SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH = b"SDL_MOUSE_FOCUS_CLICKTHROUGH" SDL_HINT_MOUSE_NORMAL_SPEED_SCALE = b"SDL_MOUSE_NORMAL_SPEED_SCALE" +SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE = b"SDL_MOUSE_RELATIVE_CURSOR_VISIBLE" SDL_HINT_MOUSE_RELATIVE_MODE_CENTER = b"SDL_MOUSE_RELATIVE_MODE_CENTER" SDL_HINT_MOUSE_RELATIVE_MODE_WARP = b"SDL_MOUSE_RELATIVE_MODE_WARP" SDL_HINT_MOUSE_RELATIVE_SCALING = b"SDL_MOUSE_RELATIVE_SCALING" @@ -289,7 +315,10 @@ SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE = b"SDL_MOUSE_RELATIVE_SYSTEM_SCALE" SDL_HINT_MOUSE_RELATIVE_WARP_MOTION = b"SDL_MOUSE_RELATIVE_WARP_MOTION" SDL_HINT_MOUSE_TOUCH_EVENTS = b"SDL_MOUSE_TOUCH_EVENTS" +SDL_HINT_ROG_GAMEPAD_MICE = b"SDL_ROG_GAMEPAD_MICE" +SDL_HINT_ROG_GAMEPAD_MICE_EXCLUDED = b"SDL_ROG_GAMEPAD_MICE_EXCLUDED" SDL_HINT_TOUCH_MOUSE_EVENTS = b"SDL_TOUCH_MOUSE_EVENTS" +SDL_HINT_TRACKPAD_IS_TOUCH_ONLY = b"SDL_TRACKPAD_IS_TOUCH_ONLY" # Joystick & Gamepad Hints @@ -305,6 +334,14 @@ SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS = b"SDL_GAMECONTROLLER_USE_BUTTON_LABELS" SDL_HINT_HIDAPI_IGNORE_DEVICES = b"SDL_HIDAPI_IGNORE_DEVICES" SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS = b"SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS" +SDL_HINT_JOYSTICK_ARCADESTICK_DEVICES = b"SDL_JOYSTICK_ARCADESTICK_DEVICES" +SDL_HINT_JOYSTICK_ARCADESTICK_DEVICES_EXCLUDED = b"SDL_JOYSTICK_ARCADESTICK_DEVICES_EXCLUDED" +SDL_HINT_JOYSTICK_BLACKLIST_DEVICES = b"SDL_JOYSTICK_BLACKLIST_DEVICES" +SDL_HINT_JOYSTICK_BLACKLIST_DEVICES_EXCLUDED = b"SDL_JOYSTICK_BLACKLIST_DEVICES_EXCLUDED" +SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES = b"SDL_JOYSTICK_FLIGHTSTICK_DEVICES" +SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED = b"SDL_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED" +SDL_HINT_JOYSTICK_GAMECUBE_DEVICES = b"SDL_JOYSTICK_GAMECUBE_DEVICES" +SDL_HINT_JOYSTICK_GAMECUBE_DEVICES_EXCLUDED = b"SDL_JOYSTICK_GAMECUBE_DEVICES_EXCLUDED" SDL_HINT_JOYSTICK_HIDAPI = b"SDL_JOYSTICK_HIDAPI" SDL_HINT_JOYSTICK_HIDAPI_CORRELATE_XINPUT = b"SDL_JOYSTICK_HIDAPI_CORRELATE_XINPUT" SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE = b"SDL_JOYSTICK_HIDAPI_GAMECUBE" @@ -324,6 +361,7 @@ SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE = b"SDL_JOYSTICK_HIDAPI_PS5_RUMBLE" SDL_HINT_JOYSTICK_HIDAPI_STADIA = b"SDL_JOYSTICK_HIDAPI_STADIA" SDL_HINT_JOYSTICK_HIDAPI_STEAM = b"SDL_JOYSTICK_HIDAPI_STEAM" +SDL_HINT_JOYSTICK_HIDAPI_STEAMDECK = b"SDL_JOYSTICK_HIDAPI_STEAMDECK" SDL_HINT_JOYSTICK_HIDAPI_SWITCH = b"SDL_JOYSTICK_HIDAPI_SWITCH" SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED = b"SDL_JOYSTICK_HIDAPI_SWITCH_HOME_LED" SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED = b"SDL_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED" @@ -339,14 +377,22 @@ SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT = b"SDL_JOYSTICK_RAWINPUT_CORRELATE_XINPUT" SDL_HINT_JOYSTICK_ROG_CHAKRAM = b"SDL_JOYSTICK_ROG_CHAKRAM" SDL_HINT_JOYSTICK_THREAD = b"SDL_JOYSTICK_THREAD" +SDL_HINT_JOYSTICK_THROTTLE_DEVICES = b"SDL_JOYSTICK_THROTTLE_DEVICES" +SDL_HINT_JOYSTICK_THROTTLE_DEVICES_EXCLUDED = b"SDL_JOYSTICK_THROTTLE_DEVICES_EXCLUDED" SDL_HINT_JOYSTICK_WGI = b"SDL_JOYSTICK_WGI" +SDL_HINT_JOYSTICK_WHEEL_DEVICES = b"SDL_JOYSTICK_WHEEL_DEVICES" +SDL_HINT_JOYSTICK_WHEEL_DEVICES_EXCLUDED = b"SDL_JOYSTICK_WHEEL_DEVICES_EXCLUDED" SDL_HINT_JOYSTICK_DEVICE = b"SDL_JOYSTICK_DEVICE" +SDL_HINT_JOYSTICK_ZERO_CENTERED_DEVICES = b"SDL_JOYSTICK_ZERO_CENTERED_DEVICES" # Platform Specific Hints +SDL_HINT_DIRECTINPUT_ENABLED = b"SDL_DIRECTINPUT_ENABLED" SDL_HINT_EMSCRIPTEN_ASYNCIFY = b"SDL_EMSCRIPTEN_ASYNCIFY" SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT = b"SDL_EMSCRIPTEN_KEYBOARD_ELEMENT" +SDL_HINT_JOYSTICK_IOKIT = b"SDL_JOYSTICK_IOKIT" +SDL_HINT_KMSDRM_DEVICE_INDEX = b"SDL_KMSDRM_DEVICE_INDEX" SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER = b"SDL_KMSDRM_REQUIRE_DRM_MASTER" SDL_HINT_LINUX_DIGITAL_HATS = b"SDL_LINUX_DIGITAL_HATS" SDL_HINT_LINUX_HAT_DEADZONES = b"SDL_LINUX_HAT_DEADZONES" @@ -359,6 +405,7 @@ SDL_HINT_RPI_VIDEO_LAYER = b"SDL_RPI_VIDEO_LAYER" SDL_HINT_RENDER_DIRECT3D11_DEBUG = b"SDL_RENDER_DIRECT3D11_DEBUG" SDL_HINT_RENDER_DIRECT3D_THREADSAFE = b"SDL_RENDER_DIRECT3D_THREADSAFE" +SDL_HINT_SHUTDOWN_DBUS_ON_QUIT = b"SDL_SHUTDOWN_DBUS_ON_QUIT" SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES = b"SDL_VIDEO_MAC_FULLSCREEN_SPACES" SDL_HINT_VIDEO_WIN_D3DCOMPILER = b"SDL_VIDEO_WIN_D3DCOMPILER" SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 = b"SDL_WINDOWS_NO_CLOSE_ON_ALT_F4" @@ -393,6 +440,7 @@ SDL_HINT_ENABLE_SCREEN_KEYBOARD = b"SDL_ENABLE_SCREEN_KEYBOARD" SDL_HINT_IDLE_TIMER_DISABLED = b"SDL_IOS_IDLE_TIMER_DISABLED" SDL_HINT_IOS_HIDE_HOME_INDICATOR = "SDL_IOS_HIDE_HOME_INDICATOR" +SDL_HINT_JOYSTICK_MFI = b"SDL_JOYSTICK_MFI" SDL_HINT_VITA_TOUCH_MOUSE_DEVICE = b"SDL_HINT_VITA_TOUCH_MOUSE_DEVICE" SDL_HINT_WINRT_PRIVACY_POLICY_URL = b"SDL_WINRT_PRIVACY_POLICY_URL" SDL_HINT_WINRT_PRIVACY_POLICY_LABEL = b"SDL_WINRT_PRIVACY_POLICY_LABEL" diff --git a/sdl2/pixels.py b/sdl2/pixels.py index bc7a6d7d..f09f02f8 100644 --- a/sdl2/pixels.py +++ b/sdl2/pixels.py @@ -15,7 +15,7 @@ "SDL_PIXELTYPE_INDEX1", "SDL_PIXELTYPE_INDEX4", "SDL_PIXELTYPE_INDEX8", "SDL_PIXELTYPE_PACKED8", "SDL_PIXELTYPE_PACKED16", "SDL_PIXELTYPE_PACKED32", "SDL_PIXELTYPE_ARRAYU8", "SDL_PIXELTYPE_ARRAYU16", "SDL_PIXELTYPE_ARRAYU32", - "SDL_PIXELTYPE_ARRAYF16", "SDL_PIXELTYPE_ARRAYF32", + "SDL_PIXELTYPE_ARRAYF16", "SDL_PIXELTYPE_ARRAYF32", "SDL_PIXELTYPE_INDEX2", "SDL_BitmapOrder", "SDL_BITMAPORDER_NONE", "SDL_BITMAPORDER_4321", "SDL_BITMAPORDER_1234", @@ -41,6 +41,7 @@ "SDL_PixelFormatEnum", "SDL_PIXELFORMAT_UNKNOWN", "SDL_PIXELFORMAT_INDEX1LSB", "SDL_PIXELFORMAT_INDEX1MSB", + "SDL_PIXELFORMAT_INDEX2LSB", "SDL_PIXELFORMAT_INDEX2MSB", "SDL_PIXELFORMAT_INDEX4LSB", "SDL_PIXELFORMAT_INDEX4MSB", "SDL_PIXELFORMAT_INDEX8", "SDL_PIXELFORMAT_RGB332", @@ -62,6 +63,8 @@ "SDL_PIXELFORMAT_ARGB2101010", "SDL_PIXELFORMAT_RGBA32", "SDL_PIXELFORMAT_ARGB32", "SDL_PIXELFORMAT_BGRA32", "SDL_PIXELFORMAT_ABGR32", + "SDL_PIXELFORMAT_RGBX32", "SDL_PIXELFORMAT_XRGB32", + "SDL_PIXELFORMAT_BGRX32", "SDL_PIXELFORMAT_XBGR32", "SDL_PIXELFORMAT_YV12", "SDL_PIXELFORMAT_IYUV", "SDL_PIXELFORMAT_YUY2", "SDL_PIXELFORMAT_UYVY", "SDL_PIXELFORMAT_YVYU", "SDL_PIXELFORMAT_NV12", "SDL_PIXELFORMAT_NV21", @@ -100,6 +103,7 @@ SDL_PIXELTYPE_ARRAYU32 = 9 SDL_PIXELTYPE_ARRAYF16 = 10 SDL_PIXELTYPE_ARRAYF32 = 11 +SDL_PIXELTYPE_INDEX2 = 12 SDL_BitmapOrder = c_int SDL_BITMAPORDER_NONE = 0 @@ -172,6 +176,7 @@ def SDL_ISPIXELFORMAT_INDEXED(pformat): return ( SDL_ISPIXELFORMAT_FOURCC(pformat) == False and ( (SDL_PIXELTYPE(pformat) == SDL_PIXELTYPE_INDEX1) or + (SDL_PIXELTYPE(pformat) == SDL_PIXELTYPE_INDEX2) or (SDL_PIXELTYPE(pformat) == SDL_PIXELTYPE_INDEX4) or (SDL_PIXELTYPE(pformat) == SDL_PIXELTYPE_INDEX8) )) @@ -229,6 +234,16 @@ def SDL_ISPIXELFORMAT_ALPHA(pformat): SDL_BITMAPORDER_1234, 0, 1, 0 ) +SDL_PIXELFORMAT_INDEX2LSB = SDL_DEFINE_PIXELFORMAT( + SDL_PIXELTYPE_INDEX2, + SDL_BITMAPORDER_4321, + 0, 2, 0 +) +SDL_PIXELFORMAT_INDEX2MSB = SDL_DEFINE_PIXELFORMAT( + SDL_PIXELTYPE_INDEX2, + SDL_BITMAPORDER_1234, + 0, 2, 0 +) SDL_PIXELFORMAT_INDEX4LSB = SDL_DEFINE_PIXELFORMAT( SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, @@ -384,11 +399,19 @@ def SDL_ISPIXELFORMAT_ALPHA(pformat): SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_ARGB8888 SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_BGRA8888 SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_ABGR8888 + SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_RGBX8888 + SDL_PIXELFORMAT_XRGB32 = SDL_PIXELFORMAT_XRGB8888 + SDL_PIXELFORMAT_BGRX32 = SDL_PIXELFORMAT_BGRX8888 + SDL_PIXELFORMAT_XBGR32 = SDL_PIXELFORMAT_XBGR8888 else: SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_ABGR8888 SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_BGRA8888 SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_ARGB8888 SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_RGBA8888 + SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_XBGR8888 + SDL_PIXELFORMAT_XRGB32 = SDL_PIXELFORMAT_BGRX8888 + SDL_PIXELFORMAT_BGRX32 = SDL_PIXELFORMAT_XRGB8888 + SDL_PIXELFORMAT_XBGR32 = SDL_PIXELFORMAT_RGBX8888 SDL_PIXELFORMAT_YV12 = SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2') SDL_PIXELFORMAT_IYUV = SDL_DEFINE_PIXELFOURCC('I', 'Y', 'U', 'V') SDL_PIXELFORMAT_YUY2 = SDL_DEFINE_PIXELFOURCC('Y', 'U', 'Y', '2') @@ -444,6 +467,13 @@ def SDL_ISPIXELFORMAT_ALPHA(pformat): } if sdl_version >= 2012: NAME_MAP['BGR444'] = SDL_PIXELFORMAT_BGR444 +if sdl_version >= 2300: + NAME_MAP['INDEX2LSB'] = SDL_PIXELFORMAT_INDEX2LSB + NAME_MAP['INDEX2MSB'] = SDL_PIXELFORMAT_INDEX2MSB + NAME_MAP['RGBX32'] = SDL_PIXELFORMAT_RGBX32 + NAME_MAP['XRGB32'] = SDL_PIXELFORMAT_XRGB32 + NAME_MAP['BGRX32'] = SDL_PIXELFORMAT_BGRX32 + NAME_MAP['XBGR32'] = SDL_PIXELFORMAT_XBGR32 ALL_PIXELFORMATS = tuple(NAME_MAP.values()) diff --git a/sdl2/test/gamecontroller_test.py b/sdl2/test/gamecontroller_test.py index f509a887..c903c74f 100644 --- a/sdl2/test/gamecontroller_test.py +++ b/sdl2/test/gamecontroller_test.py @@ -268,6 +268,12 @@ def test_SDL_GameControllerGetSerial(gamepads): serial = sdl2.SDL_GameControllerGetSerial(pad) assert serial == None or type(serial) in (str, bytes) +@pytest.mark.skipif(sdl2.dll.version < 2300, reason="not available") +def test_SDL_GameControllerGetSteamHandle(gamepads): + for pad in gamepads: + handle = sdl2.SDL_GameControllerGetSteamHandle(pad) + assert handle >= 0 + def test_SDL_GameControllerGetAttached(gamepads): for pad in gamepads: ret = sdl2.SDL_GameControllerGetAttached(pad) diff --git a/sdl2/version.py b/sdl2/version.py index 005500e7..15feae03 100644 --- a/sdl2/version.py +++ b/sdl2/version.py @@ -19,8 +19,8 @@ # Constants, enums, & macros SDL_MAJOR_VERSION = 2 -SDL_MINOR_VERSION = 28 -SDL_PATCHLEVEL = 5 +SDL_MINOR_VERSION = 30 +SDL_PATCHLEVEL = 10 def SDL_VERSION(x): x.major = SDL_MAJOR_VERSION From 0c21144850d9fbb77465d64688be7b72e34461cc Mon Sep 17 00:00:00 2001 From: Austin Hurst Date: Fri, 13 Dec 2024 16:24:40 -0400 Subject: [PATCH 2/8] Update CI tests --- .ci/getsdl2.py | 7 +++++++ .github/workflows/run_tests.yml | 35 +++++++++++++++++---------------- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/.ci/getsdl2.py b/.ci/getsdl2.py index bb5dff51..900a2b93 100644 --- a/.ci/getsdl2.py +++ b/.ci/getsdl2.py @@ -34,6 +34,13 @@ } libversions = { + '2.30.10': { + 'SDL2': '2.30.10', + 'SDL2_mixer': '2.8.0', + 'SDL2_ttf': '2.22.0', + 'SDL2_image': '2.8.2', + 'SDL2_gfx': '1.0.4' + }, '2.28.5': { 'SDL2': '2.28.5', 'SDL2_mixer': '2.6.3', diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 023db004..dbb4edb7 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -21,7 +21,7 @@ jobs: strategy: matrix: - sdl2: ['2.28.5'] + sdl2: ['2.30.10'] env: PYSDL2_DLL_VERSION: ${{ matrix.sdl2 }} @@ -55,15 +55,15 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] - sdl2: ['2.28.5'] + python-version: ['3.8', '3.10', '3.11', '3.12', '3.13'] + sdl2: ['2.30.10'] name-prefix: ['Linux (Python '] include: - python-version: 'pypy-2.7' - sdl2: '2.28.5' + sdl2: '2.30.10' name-prefix: 'Experimental / Linux (' - - python-version: 'pypy-3.8' - sdl2: '2.28.5' + - python-version: 'pypy-3.10' + sdl2: '2.30.10' name-prefix: 'Experimental / Linux (' env: @@ -104,11 +104,11 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.10'] - sdl2: ['2.28.5', '2.26.5', '2.24.0'] + python-version: ['3.12'] + sdl2: ['2.30.10', '2.28.5', '2.26.5'] name-prefix: ['macOS (Python '] include: - - python-version: '3.10' + - python-version: '3.12' sdl2: 'from Homebrew' name-prefix: 'Experimental / macOS (Python ' @@ -156,23 +156,24 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.10'] + python-version: ['3.11'] architecture: ['x64'] sdl2: [ - '2.28.5', '2.26.5', '2.24.0', '2.0.22', '2.0.20', '2.0.18', '2.0.16', '2.0.14', - '2.0.12', '2.0.10', '2.0.9', '2.0.8', '2.0.7', '2.0.6', '2.0.5' + '2.0.5', '2.0.6', '2.0.7', '2.0.8', '2.0.9', '2.0.10', '2.0.12', + '2.0.14', '2.0.16', '2.0.18', '2.0.20', '2.0.22', '2.24.0', '2.26.5', + '2.28.5', '2.30.10' ] name-prefix: ['Windows (Python '] include: - - python-version: '3.8' + - python-version: '3.11' architecture: 'x86' - sdl2: '2.28.5' + sdl2: '2.30.10' name-prefix: 'Windows 32-bit (Python ' - - python-version: '3.8' + - python-version: '3.11' architecture: 'x86' sdl2: '2.0.22' name-prefix: 'Windows 32-bit (Python ' - - python-version: '3.8' + - python-version: '3.11' architecture: 'x86' sdl2: '2.0.5' name-prefix: 'Windows 32-bit (Python ' @@ -218,7 +219,7 @@ jobs: fail-fast: false matrix: architecture: ['x86'] - sdl2: ['2.28.5', '2.0.5'] + sdl2: ['2.30.10', '2.0.5'] env: PYSDL2_DLL_VERSION: ${{ matrix.sdl2 }} From 192fee671a095137367b79a9d87d0aecb0c6e5ea Mon Sep 17 00:00:00 2001 From: Austin Hurst Date: Fri, 13 Dec 2024 16:31:34 -0400 Subject: [PATCH 3/8] Preinstall setuptools on macOS runners --- .github/workflows/run_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index dbb4edb7..040cf593 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -128,7 +128,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install pytest + python -m pip install setuptools pytest - name: Install latest SDL2 via Homebrew if: ${{ matrix.sdl2 == 'from Homebrew' }} From bfd2aa10eefaf23eddf2df9f0956ee4aeab7c111 Mon Sep 17 00:00:00 2001 From: Austin Hurst Date: Fri, 13 Dec 2024 16:55:34 -0400 Subject: [PATCH 4/8] Avoid using null audio driver on macOS CI --- sdl2/test/audio_test.py | 3 +++ sdl2/test/sdlmixer_test.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/sdl2/test/audio_test.py b/sdl2/test/audio_test.py index e05325aa..0091f5e6 100644 --- a/sdl2/test/audio_test.py +++ b/sdl2/test/audio_test.py @@ -332,6 +332,9 @@ def test_SDL_OpenCloseAudioDevice(with_sdl_audio): spec = sdl2.SDL_AudioSpec(0, 0, 0, 0) name = sdl2.SDL_GetAudioDeviceName(x, 0) assert name is not None + if name == b"Null Audio Device": + # Skip problematic dummy device on macOS CI runner + continue deviceid = sdl2.SDL_OpenAudioDevice( name, 0, reqspec, ctypes.byref(spec), sdl2.SDL_AUDIO_ALLOW_ANY_CHANGE diff --git a/sdl2/test/sdlmixer_test.py b/sdl2/test/sdlmixer_test.py index 927d98a0..95095c06 100644 --- a/sdl2/test/sdlmixer_test.py +++ b/sdl2/test/sdlmixer_test.py @@ -127,6 +127,9 @@ def test_Mix_OpenAudioDevice(): fmt = sdlmixer.MIX_DEFAULT_FORMAT flags = audio.SDL_AUDIO_ALLOW_ANY_CHANGE for device in devices: + if device == b"Null Audio Device": + # Skip problematic dummy device on macOS CI runner + continue ret = sdlmixer.Mix_OpenAudioDevice(22050, fmt, 2, 1024, device, flags) assert ret == 0 sdlmixer.Mix_CloseAudio() From 111f1f11005a081e23b3384535e453a6674e17ed Mon Sep 17 00:00:00 2001 From: Austin Hurst Date: Fri, 13 Dec 2024 17:54:53 -0400 Subject: [PATCH 5/8] Update mixer bindings to 2.8.0 --- sdl2/sdlimage.py | 2 +- sdl2/sdlmixer.py | 59 +++++++++++++++++++++++++++----------- sdl2/sdlttf.py | 2 +- sdl2/test/sdlmixer_test.py | 18 +++++++++++- 4 files changed, 61 insertions(+), 20 deletions(-) diff --git a/sdl2/sdlimage.py b/sdl2/sdlimage.py index c5a35eb9..544ef41e 100644 --- a/sdl2/sdlimage.py +++ b/sdl2/sdlimage.py @@ -48,7 +48,7 @@ def get_dll_file(): SDL_IMAGE_MAJOR_VERSION = 2 SDL_IMAGE_MINOR_VERSION = 8 -SDL_IMAGE_PATCHLEVEL = 1 +SDL_IMAGE_PATCHLEVEL = 2 def SDL_IMAGE_VERSION(x): x.major = SDL_IMAGE_MAJOR_VERSION diff --git a/sdl2/sdlmixer.py b/sdl2/sdlmixer.py index 5f2163c1..e0573f5c 100644 --- a/sdl2/sdlmixer.py +++ b/sdl2/sdlmixer.py @@ -3,7 +3,7 @@ from ctypes import POINTER as _P from .dll import DLL, SDLFunc, AttributeDict from .version import SDL_version, SDL_VERSIONNUM -from .audio import AUDIO_S16LSB, AUDIO_S16MSB, SDL_MIX_MAXVOLUME +from .audio import AUDIO_S16SYS, SDL_MIX_MAXVOLUME from .stdinc import Uint8, Uint16, Uint32, Sint16, SDL_bool from .endian import SDL_LIL_ENDIAN, SDL_BYTEORDER from .rwops import SDL_RWops, SDL_RWFromFile @@ -23,7 +23,7 @@ # Enums "MIX_InitFlags", "MIX_INIT_FLAC", "MIX_INIT_MOD", "MIX_INIT_MP3", "MIX_INIT_OGG", - "MIX_INIT_MID", "MIX_INIT_OPUS", + "MIX_INIT_MID", "MIX_INIT_OPUS", "MIX_INIT_WAVPACK", "Mix_Fading", "MIX_NO_FADING", "MIX_FADING_OUT", "MIX_FADING_IN", @@ -31,7 +31,7 @@ "Mix_MusicType", "MUS_NONE", "MUS_CMD", "MUS_WAV", "MUS_MOD", "MUS_MID", "MUS_OGG", "MUS_MP3", "MUS_MP3_MAD_UNUSED", "MUS_FLAC", "MUS_MODPLUG_UNUSED", - "MUS_OPUS", + "MUS_OPUS", "MUS_WAVPACK", "MUS_GME", # Macro Functions "SDL_MIXER_VERSION", "MIX_VERSION", "SDL_MIXER_COMPILEDVERSION", @@ -89,6 +89,7 @@ def SDL_MIXER_VERSION(x): MIX_INIT_OGG = 0x000000010 MIX_INIT_MID = 0x00000020 MIX_INIT_OPUS = 0x00000040 +MIX_INIT_WAVPACK = 0x00000080 Mix_Fading = c_int MIX_NO_FADING = 0 @@ -107,13 +108,12 @@ def SDL_MIXER_VERSION(x): MUS_FLAC = 9 MUS_MODPLUG_UNUSED = 10 MUS_OPUS = 11 +MUS_WAVPACK = 12 +MUS_GME = 13 MIX_CHANNELS = 8 MIX_DEFAULT_FREQUENCY = 44100 -if SDL_BYTEORDER == SDL_LIL_ENDIAN: - MIX_DEFAULT_FORMAT = AUDIO_S16LSB -else: - MIX_DEFAULT_FORMAT = AUDIO_S16MSB +MIX_DEFAULT_FORMAT = AUDIO_S16SYS MIX_DEFAULT_CHANNELS = 2 MIX_MAX_VOLUME = SDL_MIX_MAXVOLUME @@ -174,6 +174,7 @@ class Mix_Music(c_void_p): SDLFunc("Mix_Quit"), SDLFunc("Mix_OpenAudio", [c_int, Uint16, c_int, c_int], c_int), SDLFunc("Mix_OpenAudioDevice", [c_int, Uint16, c_int, c_int, c_char_p, c_int], c_int, added='2.0.2'), + SDLFunc("Mix_PauseAudio", [c_int], added='2.8.0'), SDLFunc("Mix_AllocateChannels", [c_int], c_int), SDLFunc("Mix_QuerySpec", [_P(c_int), _P(Uint16), _P(c_int)], c_int), SDLFunc("Mix_LoadWAV_RW", [_P(SDL_RWops), c_int], _P(Mix_Chunk)), @@ -244,6 +245,8 @@ class Mix_Music(c_void_p): SDLFunc("Mix_RewindMusic"), SDLFunc("Mix_PausedMusic", None, c_int), SDLFunc("Mix_ModMusicJumpToOrder", [c_int], c_int, added='2.6.0'), + SDLFunc("Mix_StartTrack", [_P(Mix_Music), c_int], c_int, added='2.8.0'), + SDLFunc("Mix_GetNumTracks", [_P(Mix_Music)], c_int, added='2.8.0'), SDLFunc("Mix_SetMusicPosition", [c_double], c_int), SDLFunc("Mix_GetMusicPosition", [_P(Mix_Music)], c_double, added='2.6.0'), SDLFunc("Mix_MusicDuration", [_P(Mix_Music)], c_double, added='2.6.0'), @@ -290,16 +293,17 @@ def Mix_Init(flags): The following init flags are supported: - ========== ================= + ========== ==================== Format Init flag - ========== ================= + ========== ==================== FLAC ``MIX_INIT_FLAC`` MOD ``MIX_INIT_MID`` MP3 ``MIX_INIT_MP3`` MIDI ``MIX_INIT_MID`` Ogg Vorbis ``MIX_INIT_OGG`` Opus ``MIX_INIT_OPUS`` - ========== ================= + WavPack ``MIX_INIT_WAVPACK`` + ========== ==================== This can be called multiple times to enable support for these formats separately, or can initialize multiple formats at once by passing a set of @@ -308,10 +312,11 @@ def Mix_Init(flags): whether a given decoder is available on the current system:: # Initialize FLAC and MP3 support separately - for flag in [MIX_INIT_FLAC, MIX_INIT_MP3]: - Mix_Init(flag) - err = Mix_GetError() # check for any errors loading library - if len(err): + for fmt in [MIX_INIT_FLAC, MIX_INIT_MP3]: + initialized = Mix_Init(fmt) + # Use bitwise AND to check whether the format initialized + if not (initialized & fmt) == fmt: + err = Mix_GetError() print(err) # Initialize FLAC and MP3 support at the same time @@ -321,9 +326,7 @@ def Mix_Init(flags): print(Mix_GetError()) .. note:: - This function is not guaranteed to set an error string on failure, so - the return value should be used for error checking instead of just - :func:`Mix_GetError`. + This function is not guaranteed to set an error string on failure. Args: flags (int): A bitwise OR'd set of the flags of the audio formats to @@ -430,6 +433,17 @@ def Mix_OpenAudioDevice(frequency, format, channels, chunksize, device, allowed_ frequency, format, channels, chunksize, device, allowed_changes ) +def Mix_PauseAudio(pause_on): + """Suspends or resumes all audio output. + + `Note: Added in SDL_mixer 2.8.0` + + Args: + pause_on (int): 1 to pause audio output, 0 to resume. + + """ + return _ctypes["Mix_PauseAudio"](pause_on) + def Mix_AllocateChannels(numchans): """Sets the number of channels to use for the mixer API. @@ -740,6 +754,7 @@ def Mix_GetChunkDecoder(index): b"WAVE" Waveform Audio File Format b"AIFF" Audio Interchange File Format b"VOC" Creative Voice file + b"WAVPACK" WavPack format Added in SDL_mixer 2.8.0 ============ ============================= ============================= Use the :func:`Mix_GetNumChunkDecoders` function to get the number of @@ -773,6 +788,8 @@ def Mix_GetNumMusicDecoders(): the availability of the shared libraries required for supporting different formats. + Note that some decoders (e.g. GME) will not appear as available until used. + Returns: int: The number of available music decoders. @@ -795,6 +812,8 @@ def Mix_GetMusicDecoder(index): b"OPUS" Opus Interactive Audio Codec Added in SDL_mixer 2.0.4 b"CMD External music command Not available on Windows b"WAVE" Waveform Audio File Format + b"WAVPACK" WavPack format Added in SDL_mixer 2.8.0 + b"GME" Game Music Emu library Added in SDL_mixer 2.8.0 ============= ============================= ============================= Use the :func:`Mix_GetNumMusicDecoders` function to get the number of @@ -1230,6 +1249,12 @@ def Mix_PausedMusic(): def Mix_ModMusicJumpToOrder(order): return _ctypes["Mix_ModMusicJumpToOrder"](order) +def Mix_StartTrack(music, track): + return _ctypes["Mix_StartTrack"](music, track) + +def Mix_GetNumTracks(music): + return _ctypes["Mix_GetNumTracks"](music) + def Mix_SetMusicPosition(position): return _ctypes["Mix_SetMusicPosition"](position) diff --git a/sdl2/sdlttf.py b/sdl2/sdlttf.py index fefef794..a853d1db 100644 --- a/sdl2/sdlttf.py +++ b/sdl2/sdlttf.py @@ -61,7 +61,7 @@ def get_dll_file(): # Constants, enums, type definitions, and macros SDL_TTF_MAJOR_VERSION = 2 -SDL_TTF_MINOR_VERSION = 20 +SDL_TTF_MINOR_VERSION = 22 SDL_TTF_PATCHLEVEL = 0 def SDL_TTF_VERSION(x): diff --git a/sdl2/test/sdlmixer_test.py b/sdl2/test/sdlmixer_test.py index 95095c06..0059239e 100644 --- a/sdl2/test/sdlmixer_test.py +++ b/sdl2/test/sdlmixer_test.py @@ -93,7 +93,8 @@ def test_Mix_InitQuit(): 'MP3': sdlmixer.MIX_INIT_MP3, 'OGG': sdlmixer.MIX_INIT_OGG, 'MID': sdlmixer.MIX_INIT_MID, - 'OPUS': sdlmixer.MIX_INIT_OPUS + 'OPUS': sdlmixer.MIX_INIT_OPUS, + 'WAVPACK': sdlmixer.MIX_INIT_WAVPACK, } for lib in libs.keys(): flags = libs[lib] @@ -136,6 +137,11 @@ def test_Mix_OpenAudioDevice(): sdlmixer.Mix_Quit() SDL_Quit() +@pytest.mark.skip("not implemented") +@pytest.mark.skipif(sdlmixer.dll.version < 2080, reason="Added in 2.8.0") +def test_Mix_PauseAudio(with_sdl_mixer): + pass + def test_Mix_AllocateChannels(with_sdl_mixer): # Get number currently allocated current = sdlmixer.Mix_AllocateChannels(-1) @@ -466,6 +472,16 @@ def test_Mix_PausedMusic(with_sdl_mixer): def test_Mix_ModMusicJumpToOrder(with_sdl_mixer): pass +@pytest.mark.skip("not implemented") +@pytest.mark.skipif(sdlmixer.dll.version < 2080, reason="Added in 2.8.0") +def test_Mix_StartTrack(with_sdl_mixer): + pass + +@pytest.mark.skip("not implemented") +@pytest.mark.skipif(sdlmixer.dll.version < 2080, reason="Added in 2.8.0") +def test_Mix_GetNumTracks(with_sdl_mixer): + pass + @pytest.mark.skip("not implemented") def test_Mix_SetMusicPosition(with_sdl_mixer): pass From 85e04fef91248dbe693456768680634af3504c55 Mon Sep 17 00:00:00 2001 From: Austin Hurst Date: Fri, 13 Dec 2024 18:02:44 -0400 Subject: [PATCH 6/8] Minor cleanup --- sdl2/test/sdlmixer_test.py | 3 ++- setup.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sdl2/test/sdlmixer_test.py b/sdl2/test/sdlmixer_test.py index 0059239e..cac651f6 100644 --- a/sdl2/test/sdlmixer_test.py +++ b/sdl2/test/sdlmixer_test.py @@ -38,7 +38,8 @@ def with_sdl_mixer(): # Initialize SDL_mixer and open an audio device flags = ( sdlmixer.MIX_INIT_FLAC | sdlmixer.MIX_INIT_MOD | sdlmixer.MIX_INIT_MP3 | - sdlmixer.MIX_INIT_OGG | sdlmixer.MIX_INIT_MID | sdlmixer.MIX_INIT_OPUS + sdlmixer.MIX_INIT_OGG | sdlmixer.MIX_INIT_MID | sdlmixer.MIX_INIT_OPUS | + sdlmixer.MIX_INIT_WAVPACK ) sdlmixer.Mix_Init(flags) ret = sdlmixer.Mix_OpenAudio(48000, sdlmixer.MIX_DEFAULT_FORMAT, 2, 1024) diff --git a/setup.py b/setup.py index ef6d6c5c..337a0847 100644 --- a/setup.py +++ b/setup.py @@ -42,11 +42,12 @@ "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries :: Python Modules", From 9ce4f7d61085626bfe3e62ad0c274335c462cf77 Mon Sep 17 00:00:00 2001 From: Austin Hurst Date: Fri, 13 Dec 2024 18:08:58 -0400 Subject: [PATCH 7/8] Update news.rst --- doc/news.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/news.rst b/doc/news.rst index f1901b77..1b79c65b 100644 --- a/doc/news.rst +++ b/doc/news.rst @@ -9,6 +9,8 @@ New Features: * Updated to wrap new function added in SDL_image 2.8.0 (PR #274). * Updated to wrap new hints added in SDL 2.28.2 and 2.28.5 (PR #274). +* Updated to wrap new functions and constants in SDL2 2.30.10 (PR #277). +* Updated to wrap new functions and constants in SDL_mixer 2.8.0 (PR #277). * Added a new function :func:`~sdl2.ext.get_key_state` for checking if a given key is currently down or up independently of the SDL event queue. From db568b05c17e176ff45c2ff28ebea29ac781e753 Mon Sep 17 00:00:00 2001 From: Austin Hurst Date: Fri, 13 Dec 2024 18:13:39 -0400 Subject: [PATCH 8/8] Add tests for INDEX2 formats --- sdl2/test/pixels_test.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sdl2/test/pixels_test.py b/sdl2/test/pixels_test.py index 688f6531..b84b1d43 100644 --- a/sdl2/test/pixels_test.py +++ b/sdl2/test/pixels_test.py @@ -78,6 +78,7 @@ def test_SDL_PIXELLAYOUT(): def test_SDL_BITSPERPIXEL(): bitspp = sdl2.SDL_BITSPERPIXEL assert bitspp(sdl2.SDL_PIXELFORMAT_INDEX1LSB) == 1 + assert bitspp(sdl2.SDL_PIXELFORMAT_INDEX2LSB) == 2 assert bitspp(sdl2.SDL_PIXELFORMAT_INDEX4LSB) == 4 assert bitspp(sdl2.SDL_PIXELFORMAT_RGB332) == 8 assert bitspp(sdl2.SDL_PIXELFORMAT_ARGB8888) == 32 @@ -85,6 +86,7 @@ def test_SDL_BITSPERPIXEL(): def test_SDL_BYTESPERPIXEL(): bytespp = sdl2.SDL_BYTESPERPIXEL assert bytespp(sdl2.SDL_PIXELFORMAT_INDEX1LSB) == 0 + assert bytespp(sdl2.SDL_PIXELFORMAT_INDEX2LSB) == 0 assert bytespp(sdl2.SDL_PIXELFORMAT_INDEX4LSB) == 0 assert bytespp(sdl2.SDL_PIXELFORMAT_RGB332) == 1 assert bytespp(sdl2.SDL_PIXELFORMAT_ARGB8888) == 4 @@ -96,6 +98,8 @@ def test_SDL_ISPIXELFORMAT_INDEXED(): isindexed = sdl2.SDL_ISPIXELFORMAT_INDEXED assert isindexed(sdl2.SDL_PIXELFORMAT_INDEX1LSB) assert isindexed(sdl2.SDL_PIXELFORMAT_INDEX1MSB) + assert isindexed(sdl2.SDL_PIXELFORMAT_INDEX2LSB) + assert isindexed(sdl2.SDL_PIXELFORMAT_INDEX2MSB) assert isindexed(sdl2.SDL_PIXELFORMAT_INDEX4LSB) assert isindexed(sdl2.SDL_PIXELFORMAT_INDEX4MSB) assert isindexed(sdl2.SDL_PIXELFORMAT_INDEX8) @@ -110,6 +114,7 @@ def test_SDL_ISPIXELFORMAT_ALPHA(): assert isalpha(sdl2.SDL_PIXELFORMAT_RGBA4444) assert isalpha(sdl2.SDL_PIXELFORMAT_ABGR1555) assert not isalpha(sdl2.SDL_PIXELFORMAT_INDEX1LSB) + assert not isalpha(sdl2.SDL_PIXELFORMAT_INDEX2LSB) assert not isalpha(sdl2.SDL_PIXELFORMAT_INDEX4MSB) assert not isalpha(sdl2.SDL_PIXELFORMAT_RGB332) assert not isalpha(sdl2.SDL_PIXELFORMAT_YUY2)