Skip to content

PySDL2 0.9.16

Latest
Compare
Choose a tag to compare
@a-hurst a-hurst released this 28 Jun 14:37
· 9 commits to master since this release

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.