Skip to content

Releases: py-sdl/py-sdl2

PySDL2 0.9.16

28 Jun 14:37
Compare
Choose a tag to compare

As the year enters into summer, PySDL2 enters another release cycle! The bindings have been updated to wrap the new functions and constants added in SDL 2.28.0 (the final major release of SDL2). Additionally, some new functions and methods have been added to sdl2.ext.

The biggest change in this release is the addition of a new sdl2.ext module ext.input that provides a set of Pythonic functions for handling keyboard, mouse, and text entry events from the SDL event queue (e.g. key_pressed(), mouse_clicked()). These, along with the new sdl2.ext.quit_requested() function, make it possible to handle many SDL input processing loops without the need to loop over each event individually.

Additionally, this release adds a new method to the sdl2.ext.Renderer class, Renderer.rcopy(), for drawing textures to the renderer with relative alignment (i.e. aligning a given point on the texture to a given point on the rendering context). This method lets you draw textures centered in the window or aligned to an edge/corner without needing to manually calculate the offset of the top-left corner based on the texture's size.

Changelog

  • Updated to wrap new functions and constants in SDL 2.28.0.
  • Added a new method to sdl2.ext.Renderer, Renderer.rcopy(), for drawing textures to the renderer with relative alignment.
  • Added a new module, sdl2.ext.input for processing common SDL input events in a Pythonic manner.
  • Added a new function sdl2.ext.quit_requested() for checking whether an SDL event queue contains any sdl2.SDL_QUIT events.

PySDL 0.9.15

08 Jan 19:36
Compare
Choose a tag to compare

A new PySDL2 to go with the new year! The bindings have been updated to wrap the new functions and constants added in SDL 2.26.0, a few bugs have been fixed, and various improvements have been made to sdl2.ext.

Apart from SDL 2.26.0 support, the biggest change is the addition of a new sdl2.ext module (ext.mouse) that provides a friendly Pythonic API for working with the mouse in PySDL2. You can now get and set the cursor position without ctypes pointers, and check the state of the mouse buttons without using a bit mask! Additionally, the sdl2.ext.Point and sdl2.ext.Rect classes now support Pythonic unpacking (e.g. x, y, w, h = sdl_rect), making them a bit nicer to work with.

Changelog

  • Updated to wrap new functions and constants in SDL 2.26.0.
  • Added a new module sdl2.ext.mouse for showing/hiding/moving/retrieving the mouse cursor and querying the current state of the mouse buttons.
  • Added indexing/unpacking support to the sdl2.ext.Point and sdl2.ext.Rect classes and their float equivalents.
  • Updated sdl2.ext.SpriteFactory.from_image() to allow passing PIL.Image.Image objects directly.
  • Improved sdl2.ext.Texture performance.
  • Fixed a bug preventing SDL Points and Rects from being used as srcrect or dstrect for sdl2.ext.Renderer.copy().
  • Added a binding for SDL_ResetHint, which was added in SDL 2.24.0 but got missed in PR #246.

PySDL2 0.9.14

03 Sep 17:12
Compare
Choose a tag to compare

As summer comes to a close, so does another PySDL2 release cycle! The bindings have been updated to wrap the new functions and constants added in SDL 2.24.0, a few small bugs have been fixed, and a couple small improvements have been made to the sdl2.ext modules.

Apart from SDL 2.24.0 support, the biggest change is the addition of a new ext function and class (get_displays and DisplayInfo) for easily retrieving information about the names and supported video modes of all connected displays. Additionally, the previously internal raise_sdl_err function for cleanly raising informative Python exceptions for SDL errors has been added to the public API to make it easier to write robust code with the direct SDL2 bindings.

Changelog

  • Updated to wrap new functions and constants in SDL 2.24.0.
  • Added a new module sdl2.ext.displays for retrieving and working with connected displays and their supported resolutions/refresh rates.
  • Extended sdl2.ext.init to allow initializing all SDL subsystems individually (previously just initialized the video subsystem).
  • Improved the memory safety of the sdl2.ext.Window class.
  • Added raise_sdl_err to the public ext API.
  • Fixed sdl2.ext.line to work correctly on 1bpp surfaces.
  • Various fixes/improvements to the unit test suite for Linux package maintainers.

PySDL2 0.9.13

26 Jul 19:12
Compare
Choose a tag to compare

Right on the heels of 0.9.12 comes PySDL2 0.9.13! The main changes here are that the bindings, documentation, and unit tests have been updated for the latest releases of SDL_image, SDL_mixer, and SDL_ttf. Experimental bindings for the new functions and structures in the SDL 2.23.1 pre-release have also been added if you're feeling adventurous.

Additionally, this release adds a new function sdl2.ext.load_svg that allows for easily loading simple SVG images at arbitrary resolutions if using SDL_image 2.6.0 or newer.

Changelog

  • Updated to wrap new functions and constants in SDL_ttf 2.20.0.
  • Updated to wrap new functions and constants in SDL_mixer 2.6.0.
  • Updated to wrap new functions and constants in SDL_image 2.6.0.
  • Added experimental bindings for the new functions and constants in the SDL 2.23.1 pre-release.
  • Added a new function :func:sdl2.ext.load_svg that allows loading simple SVG images at arbitrary resolutions with SDL_image 2.6.0 or later.

PySDL2 0.9.12

19 Jul 15:40
Compare
Choose a tag to compare

It's time for another PySDL2 release! Most of the changes since 0.9.11 are bugfixes, but this new release also adds bindings for new SDL2 functions added in 2.0.22 as well as a stable API for accessing the raw ctypes function objects for SDL2 functions.

In future releases of PySDL2, I hope to replace the direct ctypes bindings for SDL2 functions with thin Python function wrappers around the ctypes bindings, allowing for kwargs support, much improved IDE integration, inline documentation, and more. For edge-case projects that need to use the ctypes function objects directly, the new API adds a _ctypes object in each module that exposes the ctypes object for each bindings as an attribute (e.g. sdlttf._ctypes.TTF_Linked_Version).

Changelog

  • Added bindings for new functions and constants introduced in SDL2 2.0.22
  • Added a stable API for accessing the raw ctypes function objects for SDL2 functions
  • Various bugfixes (see the project's news.rst for more info)

PySDL2 0.9.11

27 Jan 15:41
Compare
Choose a tag to compare

This is the official release PySDL2 0.9.11! This release contains updated bindings for the latest SDL2 and SDL2_ttf functions and constants. It also contains a major overhaul of PySDL2's unit test setup, which should have no effect for most users.

Changelog

  • Added bindings for new functions and constants introduced in SDL2 2.0.20
  • Added bindings and documentation for new functions and constants introduced in SDL2_ttf 2.0.18

PySDL2 0.9.10

11 Jan 22:58
Compare
Choose a tag to compare

This is the official release PySDL2 0.9.10! This is a big one, folks.

This release updates the bindings to support new functions and hints added in SDL2 2.0.18, added documentation and kwargs support for the ttf/mixer/image/gfx functions, and adds a wide range of improvements, documentation, bug fixes, and new functions/classes to the sdl2.ext module.

Changelog

Full details can be found in the project's news.rst, but the main new features are:

  • Added bindings for new functions and constants introduced in SDL2 2.0.18
  • Added experimental support for SDL 2.0.3 and 2.0.4 for older platforms (tested on an iMac G4 running 10.4.11)
  • Major improvements to the ext.pixelaccess module
  • Major rewrite of the ext.image module
  • New object-oriented method of rendering with sdl2.ext.Renderers using the new sdl2.ext.Texture class
  • Major expansion and rewrite of the sdl2.ext.Renderer class
  • New powerful sdl2.ext.FontTTF class for font rendering
  • Redocumented most of the sdl2.ext modules for better clarity and maintainability
  • Added automatic detection of Homebrew SDL2 binaries on Apple Silicon Macs as a fallback
  • Deprecated a number of sdl2.ext modules and functions

PySDL2 0.9.9

02 Sep 19:35
Compare
Choose a tag to compare

This is the official release PySDL2 0.9.9! This release updates the bindings to support new functions and hints added in SDL2 2.0.16, and also fixes a critical sdl2.ext.Window bug introduced in 0.9.8.

Changelog

  • Added bindings for new functions and constants introduced in SDL2 2.0.16
  • Reverted the fix for issue #139 which inadvertently caused Window.show() to force the window to use SDL2's software rendering, breaking the Renderer class and compatibility with PyOpenGL.

PySDL2 0.9.8

06 Aug 17:06
Compare
Choose a tag to compare

This is the official release PySDL2 0.9.8! This release fixes a number of bugs, updates the bindings to support new functions in SDL2 2.0.14, adds a wrapper for the SDL2 MessageBox API, and more.

Changelog

Full details can be found in the project's news.rst, but the main new features are:

  • Added bindings for new functions and constants introduced in SDL2 2.0.12 and 2.0.14
  • Added full support for SDL2 binaries in non-system locations (e.g., with pysdl2-dll) when using PySDL2 with Python installed from the Microsoft Store on Windows.
  • Improved handling of SDL2 binaries that are too old to be used with PySDL2.
  • Added a new sdl2.ext API for displaying SDL2 MessageBox alerts and dialog boxes.

PySDL2 0.9.8 - Release Candidate 1

27 Jun 19:22
Compare
Choose a tag to compare
Pre-release

This is a pre-release of PySDL2 0.9.8, containing most of the core features and fixes to be included in the next official release of PySDL2!

Changelog

Full details can be found in the project's news.rst, but the main new features are:

  • Added bindings for new functions and constants introduced in SDL2 2.0.12 and 2.0.14
  • Added full support for SDL2 binaries in non-system locations (e.g., with pysdl2-dll) when using PySDL2 with Python installed from the Microsoft Store on Windows.
  • Improved handling of SDL2 binaries that are too old to be used with PySDL2.

Installation

This pre-release can be installed directly from GitHub with pip using the following command:

python -m pip install -U https://github.com/marcusva/py-sdl2/releases/download/pre_0.9.8.rc1/pysdl2.tar.gz