Skip to content

Commit

Permalink
Update to latest SDL3 pre-releases
Browse files Browse the repository at this point in the history
  • Loading branch information
misl6 committed Jan 17, 2025
1 parent 5380b27 commit c3a0193
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 45 deletions.
18 changes: 0 additions & 18 deletions kivy/core/image/_img_sdl3.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions kivy/core/image/img_sdl3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'''
Expand Down
6 changes: 0 additions & 6 deletions kivy/lib/sdl3.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
14 changes: 6 additions & 8 deletions tools/build_linux_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
18 changes: 8 additions & 10 deletions tools/build_macos_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit c3a0193

Please sign in to comment.