From 3521c90761ddf3e7716455511cddf4da580bd106 Mon Sep 17 00:00:00 2001 From: drakbar <20728117+drakbar@users.noreply.github.com> Date: Tue, 8 Apr 2025 13:51:38 -0500 Subject: [PATCH] add SDL_AppInit argument parser --- sdl3/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sdl3/__init__.py b/sdl3/__init__.py index 527ae7a..d9a5a74 100644 --- a/sdl3/__init__.py +++ b/sdl3/__init__.py @@ -354,6 +354,9 @@ def __class_getitem__(cls, key: tuple[str, type, list[type]]) -> type: SDL_ENUM: typing.TypeAlias = SDL_TYPE["SDL_ENUM", ctypes.c_int] SDL_VA_LIST: typing.TypeAlias = SDL_TYPE["SDL_VA_LIST", ctypes.c_char_p] +def SDL_PARSE_ARGUMENTS(argc: ctypes.c_int, argv: SDL_POINTER[ctypes.c_char_p]) -> typing.List[str]: + return [SDL_DEREFERENCE(argv[i]).decode("utf-8") for i in range(argc)] + def SDL_PROCESS_DESCRIPTION(description: str, url: str | None = None, rst: bool = False) -> str: """Process HTML description."""