diff --git a/kivy/core/image/_img_sdl3.pyx b/kivy/core/image/_img_sdl3.pyx index 4760aba30b..29c4bff819 100644 --- a/kivy/core/image/_img_sdl3.pyx +++ b/kivy/core/image/_img_sdl3.pyx @@ -6,8 +6,6 @@ from libc.string cimport memset from libc.stdlib cimport malloc from cpython cimport bool -cdef int _is_init = 0 - cdef struct BytesIODataContainer: void* data @@ -45,22 +43,6 @@ cdef SDL_IOStream *rwops_bridge_to_bytesio(byteio): return rwops -def init(): - global _is_init - if _is_init: - return - - cdef int ret - for flags in (IMG_INIT_JPG, IMG_INIT_PNG, IMG_INIT_TIF, IMG_INIT_WEBP): - ret = IMG_Init(flags) - if ret & flags != flags: - # FIXME replace flags by a good string - Logger.error( - 'ImageSDL3: Failed to init required {} support'.format(flags)) - Logger.error('ImageSDL3: {}'.format(SDL_GetError())) - - _is_init = 1 - def save(filename, w, h, pixelfmt, pixels, flipped, imagefmt, quality=90): cdef bytes c_filename = None cdef SDL_IOStream *rwops diff --git a/kivy/core/image/img_sdl3.py b/kivy/core/image/img_sdl3.py index 36615c0412..679ce96cb8 100644 --- a/kivy/core/image/img_sdl3.py +++ b/kivy/core/image/img_sdl3.py @@ -19,9 +19,6 @@ class ImageLoaderSDL3(ImageLoaderBase): '''Image loader based on SDL3_image''' - def _ensure_ext(self): - _img_sdl3.init() - @staticmethod def extensions(): '''Return accepted extensions for this loader''' diff --git a/kivy/lib/sdl3.pxi b/kivy/lib/sdl3.pxi index 857349e3e5..0f2a7209ea 100644 --- a/kivy/lib/sdl3.pxi +++ b/kivy/lib/sdl3.pxi @@ -689,12 +689,6 @@ cdef extern from "SDL.h": Uint16 SDL_BIG_ENDIAN cdef extern from "SDL_image.h": - ctypedef enum IMG_InitFlags: - IMG_INIT_JPG - IMG_INIT_PNG - IMG_INIT_TIF - IMG_INIT_WEBP - cdef int IMG_Init(IMG_InitFlags flags) cdef SDL_Surface *IMG_Load(char *file) cdef SDL_Surface *IMG_Load_IO(SDL_IOStream *src, int freesrc) cdef int IMG_SavePNG(SDL_Surface *src, char *file) diff --git a/tools/build_linux_dependencies.sh b/tools/build_linux_dependencies.sh index 6f1200e1c9..253f8c014c 100755 --- a/tools/build_linux_dependencies.sh +++ b/tools/build_linux_dependencies.sh @@ -2,16 +2,14 @@ set -e -x # manylinux SDL3 -MANYLINUX__SDL3__VERSION="3.1.2" -MANYLINUX__SDL3__URL="https://github.com/libsdl-org/SDL/archive/refs/heads/main.tar.gz" -MANYLINUX__SDL3__FOLDER="SDL-main" +MANYLINUX__SDL3__VERSION="3.1.10" +MANYLINUX__SDL3__URL="https://github.com/libsdl-org/SDL/releases/download/prerelease-$MANYLINUX__SDL3__VERSION/SDL3-$MANYLINUX__SDL3__VERSION.tar.gz" +MANYLINUX__SDL3__FOLDER="SDL3-$MANYLINUX__SDL3__VERSION" # manylinux SDL3_image -# MANYLINUX__SDL2_IMAGE__VERSION="2.8.0" -# MANYLINUX__SDL2_IMAGE__URL="https://github.com/libsdl-org/SDL_image/releases/download/release-$MANYLINUX__SDL2_IMAGE__VERSION/SDL2_image-$MANYLINUX__SDL2_IMAGE__VERSION.tar.gz" -# MANYLINUX__SDL2_IMAGE__FOLDER="SDL2_image-$MANYLINUX__SDL2_IMAGE__VERSION" -MANYLINUX__SDL3_IMAGE__URL="https://github.com/libsdl-org/SDL_image/archive/refs/heads/main.tar.gz" -MANYLINUX__SDL3_IMAGE__FOLDER="SDL_image-main" +MANYLINUX__SDL3_IMAGE__VERSION="3.1.0" +MANYLINUX__SDL3_IMAGE__URL="https://github.com/libsdl-org/SDL_image/releases/download/preview-$MANYLINUX__SDL3_IMAGE__VERSION/SDL3_image-$MANYLINUX__SDL3_IMAGE__VERSION.tar.gz" +MANYLINUX__SDL3_IMAGE__FOLDER="SDL3_image-$MANYLINUX__SDL3_IMAGE__VERSION" # manylinux SDL3_mixer # MANYLINUX__SDL2_MIXER__VERSION="2.6.3" diff --git a/tools/build_macos_dependencies.sh b/tools/build_macos_dependencies.sh index 42d723a5df..7647a22cc9 100755 --- a/tools/build_macos_dependencies.sh +++ b/tools/build_macos_dependencies.sh @@ -4,16 +4,14 @@ set -e -x USE_LEGACY_OPENGL="${USE_LEGACY_OPENGL:-0}" # macOS SDL3 -# MACOS__SDL3__VERSION="3.1.2" -MACOS__SDL3__URL="https://github.com/libsdl-org/SDL/archive/refs/heads/main.tar.gz" -MACOS__SDL3__FOLDER="SDL-main" - -# macOS SDL2_image -# MACOS__SDL2_IMAGE__VERSION="2.8.0" -# MACOS__SDL2_IMAGE__URL="https://github.com/libsdl-org/SDL_image/releases/download/release-$MACOS__SDL2_IMAGE__VERSION/SDL2_image-$MACOS__SDL2_IMAGE__VERSION.tar.gz" -# MACOS__SDL2_IMAGE__FOLDER="SDL2_image-${MACOS__SDL2_IMAGE__VERSION}" -MACOS__SDL3_IMAGE__URL="https://github.com/libsdl-org/SDL_image/archive/refs/heads/main.tar.gz" -MACOS__SDL3_IMAGE__FOLDER="SDL_image-main" +MACOS__SDL3__VERSION="3.1.10" +MACOS__SDL3__URL="https://github.com/libsdl-org/SDL/releases/download/prerelease-$MACOS__SDL3__VERSION/SDL3-$MACOS__SDL3__VERSION.tar.gz" +MACOS__SDL3__FOLDER="SDL3-$MACOS__SDL3__VERSION" + +# macOS SDL3_image +MACOS__SDL3_IMAGE__VERSION="3.1.0" +MACOS__SDL3_IMAGE__URL="https://github.com/libsdl-org/SDL_image/releases/download/preview-$MACOS__SDL3_IMAGE__VERSION/SDL3_image-$MACOS__SDL3_IMAGE__VERSION.tar.gz" +MACOS__SDL3_IMAGE__FOLDER="SDL3_image-$MACOS__SDL3_IMAGE__VERSION" # macOS SDL3_mixer # MACOS__SDL2_MIXER__VERSION="2.6.3"