Releases: pygame-community/pygame-ce
2.5.2
☀️🎃👻🕸️🕷️🧛🧟♂️🧙♀️🧙♂️🕯️🪦🍬🍭🍫☠️⚰️🔮🧹🌕🐈⬛🦇🌌
pip uninstall pygame
(if previously installed, to avoid package conflicts)
pip install pygame-ce --upgrade
☀️🎃👻🕸️🕷️🧛🧟♂️🧙♀️🧙♂️🕯️🪦🍬🍭🍫☠️⚰️🔮🧹🌕🐈⬛🦇🌌
We're pumped to drop another pygame-ce release, thanks to the awesome efforts of 30+ contributors in this release! In the last couple of months, we've together made 286 commits, updated 281 files, and merged 85 pull requests.
Now, let's dive into what's new!
New and improved API
-
pygame.Window
has left experimental status and now been declared public API (contributed by @Starbuck5 in #3170). @damusss further enhanced the API by adding theWindow.flash
method andWindow.focused
property in #3054 and #3079 respectively. -
@damusss added a new module,
pygame.typing
, in #3002 that exports commonly used type aliases for use in type hinting. -
The experimental
pygame.geometry
module saw more API porting from its development repository in this release. A big thanks to allgeometry
project contributors: @novialriptide, @Emc2356, @itzpr3d4t0r, @ScriptLineStudios, @avaxar, @Matiiss, @newpaxonian, @maqa41, @blankRiot96, @gresm- New contributor @MrRedstone058 added additional
Circle
attributes in #3127 - @itzpr3d4t0r added the
Circle.intersect
method and the base for theLine
class in #3071 and #3131 respectively. - @damusss added the
Circle.collidelist(all)
method in #2880
- New contributor @MrRedstone058 added additional
-
@ScriptLineStudios added the
transform.solid_overlay
function in #2304 making it easier to create a single color version of an alpha possessing surface. -
@damusss added the
desktop
argument tomouse.get_pos
andmouse.get_pressed
in #3105 so you can get the position of the mouse outside of the pygame window, where this is supported by the OS. -
@damusss added the
pygame.Sound
alias to denotepygame.mixer.Sound
in #3063. That should save a few precious characters of typing.
Bugfixes
-
@Starbuck5 fixed an OpenGL issue in
Window
init in #3059 -
@oddbookworm fixed a break when the OS resizes the window in
set_mode
in #2992 -
@bilhox fixed segfault with antialiased draw functions with a depth different than 32bits in #3008
-
@pmp-p did some fixes for improved wasm support in #3137 and #3163
-
@MyreMylar fixed midi timer reset when quit in #3018
-
- Fixed aalines overlap issue in #2912
- Fixed missing pixels in
aalines
when using integer coordinates in #3144
General Enhancements
- @oddbookworm improved
Vector{2,3}.__delattr__
messaging when deletingx, y, {z}
and removedVector4
zombies in #3069, and @ankith26 applied some more related updates in #3087 - @bilhox made it so that too many arguments to
Color.from_{colorspace}
style methods now raise errors in #3125 - @damusss added handling for all color types in
transform.threshold
in #3156
Performance Enhancements
-
@Starbuck5 updated more places in
rect
code to usePyObject_Vectorcall
in #3048. The affected methods therefore see 15-22% improvements in speed.
Docs and Type Hints
-
New contributor @MrValdez added example on how
Window
behaves withWINDOWCLOSE
andQUIT
events in #3115 -
New contributor @datapythonista clarified how
Rect
and positions relate in the intro tutorial in #3111 -
@oddbookworm fixed a couple of versionadded tags that should have been versionaddedold in
display
docs in #3046 -
@itzpr3d4t0r improved
geometry
docs in #3043 -
@Starbuck5 fixed
transform.average_color
docs and stubs to match implementation in #3076 -
@yunline updated the dependency section of zh-cn README in #3119
-
@zoldalma999 fix stubcheck typing error on windows in #3147
Examples and Unit Tests
-
New contributor @avpai-dinosaur fixed
test_inflate_ip__larger
unit test in #3098
Code Quality and General Maintenance
-
New contributor @raspofabs migrated
pkgdata
code to importlib to resolve warning aboutpkg_resources
in #3061 -
@zoldalma999 ported the controller module to C in #2056
-
@oddbookworm added code coverage CI in #2990
-
- Switched code to use
PyObject_CallOneArg
where applicable in #3023 - Drop MSYS2 clang32 from our CI in #3116
- Fix whitespace and eof formatting with pre-commit in #3104
- Fix a compiler warning in debug mode in #3124
- Made sure our CI and build dependency versions are all up to date in #3123, #3100 and #3118
- Switched code to use
-
@ankith26 and @Starbuck5 continued on the work to get pygame-ce compiling with the latest SDL3 prerelease in #3141, #2975, #3145, #2933, #3146, and #3160
-
@oddbookworm and @Starbuck5 kept our SDL dependency updated in #3094 and #3168 respectively
-
@ankith26 and @Starbuck5 kept the dev release process running in #3042 and #3173 respectively
-
@dependabot kept our CI dependencies updated in #3065, #3095, #3051, #3050, #3081, #3103, https://githu...
2.5.2.dev2
Pre release version of 2.5.2 for testing, we appreciate everyone who tests out our dev releases!
Release highlights
- Promoted pygame.Window to public API. Allows use of multiple windows at once, new window operations.
- Various rect optimizations
- Dependency updates: SDL and lower level C libraries
- New module pygame.typing
- Fixed segfault in antialiased draw functions with non 32 bit surfaces
What's Changed
- 2.5.2.dev1 by @ankith26 in #3042
- Fixed a couple of versionadded tags that should have been versionaddedold in
display
docs by @oddbookworm in #3046 - Bump docker/build-push-action from 6.5.0 to 6.6.1 by @dependabot in #3051
- Bump actions/attest-build-provenance from 1.4.0 to 1.4.1 by @dependabot in #3050
- Improved geometry docs by @itzpr3d4t0r in #3043
- Fix imposter opengl by @Starbuck5 in #3059
- Add
Window.flash(operation)
by @damusss in #3054 - Add pygame.typing module by @damusss in #3002
- Use PyObject_Vectorcall in rect by @Starbuck5 in #3048
- Version-getters SDL2/SDL3 by @Starbuck5 in #2975
- Coverage CI created, hopefully it works first time lol by @oddbookworm in #2990
- Bump docker/build-push-action from 6.6.1 to 6.7.0 by @dependabot in #3065
- Optimized
Rect.clipline()
by @itzpr3d4t0r in #3067 - Optimized tuple creation for Rect getters by @itzpr3d4t0r in #3072
- Update
FRect
repr to handle larger values by @ankith26 in #3077 - Bump actions/attest-build-provenance from 1.4.1 to 1.4.2 by @dependabot in #3081
- Fix average_color docs and stubs to match implementation by @Starbuck5 in #3076
- Fix and improve
pygame.typing
module by @aatle in #3080 - Add
Window.focused
by @damusss in #3079 - Add alias
pygame.Sound
by @damusss in #3063 - Port the controller module to C. by @zoldalma999 in #2056
- Fix break when the OS resizes our window in
set_mode
by @oddbookworm in #2992 - Make experimental API not hidden in the docs anymore by @bilhox in #3068
Vector{2,3}.__delattr__
messaging fixed when deletingx, y, {z}
and removedVector4
zombies by @oddbookworm in #3069- Use PyObject_CallOneArg where applicable by @ankith26 in #3023
- migrate importlib to resolve warning about pkg_resources by @raspofabs in #3061
- Make
pygame.typing.PathLike
internal/private by @aatle in #3086 - Updated SDL version to 2.30.7 by @oddbookworm in #3094
- Fix test_inflate_ip__larger. by @avpai-dinosaur in #3098
- Bump actions/attest-build-provenance from 1.4.2 to 1.4.3 by @dependabot in #3095
- Add
Circle.intersect()
by @itzpr3d4t0r in #3071 - Remove RGBATuple by @Starbuck5 in #3102
- Fix component bounds checking by @ankith26 in #3087
- Bump build dependencies by @ankith26 in #3100
- Enhance
pygame.mouse.get_pressed
docs by @damusss in #3084 - Bump pypa/cibuildwheel from 2.20.0 to 2.21.0 by @dependabot in #3103
- Bump pypa/cibuildwheel from 2.21.0 to 2.21.1 by @dependabot in #3112
- Drop MSYS2 clang32 from our CI by @ankith26 in #3116
- Fix whitespace and eof formatting with pre-commit by @ankith26 in #3104
- Fix segfault with antialiased draw functions with a depth different than 32bits by @bilhox in #3008
- Add japanese readme by @hisa10 in #3114
- Update the dependency section of zh-cn README by @yunline in #3119
- Add
desktop
argument tomouse.get_pos
andmouse.get_pressed
by @damusss in #3105 - added example on how Window behaves with WINDOWCLOSE and QUIT events by @MrValdez in #3115
- Fix editable install on windows by @ankith26 in #3117
- Add
Circle.collidelist/collidelistall()
by @damusss in #2880 - Fix midi timer reset when quit by @MyreMylar in #3018
- Make
copy
methods explicit for linting by @damusss in #3129 - Fix a compiler warning in debug mode by @ankith26 in #3124
- Set error when too many numbers of argument in
pygame.Color.from_colorspace
by @bilhox in #3125 - Bump actions/checkout from 4.1.7 to 4.2.0 by @dependabot in #3135
- Bump docker/build-push-action from 6.7.0 to 6.8.0 by @dependabot in #3136
- Added additional circle attributes by @MrRedstone058 in #3127
- Bump ubuntu to 24.04 on CI, fix cppcheck by @ankith26 in #3123
- Clarify how Rect and positions relate in the intro tutorial by @datapythonista in #3111
- Fix aalines overlap by @mzivic7 in #2912
- wasm: controller is not multiphase init + workaround for wasm 313t by @pmp-p in #3137
- Rename
pygame.typing.Coordinate
toPoint
, fix related grammar by @aatle in #3139 - Fix
(F)Rect.scale_by(_ip)
handling of thescale_by
parameter by @ankith26 in #3078 - Add 9-patch to examples by @damusss in #2985
- transform.solid_overlay by @ScriptLineStudios in #2304
- Add draw.aaline width argument by @mzivic7 in #3140
- New up-to-date review of french readme + note of when it was last reviewed by @bilhox in #3142
- Missing pixels in
aalines
when using integer coordinates by @mzivic7 in #3144 - Add meson flag for compiling with SDL3 by @ankith26 in #3141
- SDL3: compile rect, bufferproxy, math, newbuffer, geometry by @ankith26 in #3145
- Fixes for rwobject (now iostream) SDL3 by @Starbuck5 in #2933
- SDL3 support for pygame.system by @Starbuck5 in #3146
- Fix stubcheck error on windows, mark typealiases as such in typing by @zoldalma999 in #3147
- Bump docker/build-push-action from 6.8.0 to 6.9.0 by @dependabot in #3151
- Bump actions/cache from 4.0.2 to 4.1.0 by @dependabot in #3153
- Add Italian README by @damusss in #3120
- Bump pypa/cibuildwheel from 2.21.1 to 2.21.3 by @dependabot in #3161
- Adjust pg_MappedColorFromObj API for SDL3-porting by @Starbuck5 in #3160
- Fix handling all color types in
pygame.transform.threshold
by @damusss in #3156 - Improve color notation in the docs by @damusss in #3165
- SDL 2.30.8 by @Starbuck5 in #3168
- Add basic pygame.typing unit test, remove problematic TypeAlias usage by @ankith26 in #3150
- Added
geometry.Line
base by @itzpr3d4t0r in #3131 - wasm: better wasm fencing by @pmp-p in https://github.com/pyg...
2.5.1
☀️🌊🏖️😎🏄🐚🌈🏝️🍹☀️🌊🏖️🎉
pip uninstall pygame
(if previously installed, to avoid package conflicts)
pip install pygame-ce --upgrade
☀️🌊🏖️😎🏄🐚🌈🏝️🍹☀️🌊🏖️🎉
We are pleased to do yet another release of pygame-ce, and this has been possible due to the efforts of over 20 code contributors. Together, we have made 193 commits across 139 files via 80 pull requests in the last 2 months since the previous release!
Now, onto the highlights!
Highlights
-
Added Python 3.13 (just standard 3.13, no free threading yet) and PyPy for apple silicon support.
-
We have a new logo!
- We haven't run out of optimization ideas yet 😅, we've managed to cram a few more in this release.
New API
- There is now a default destination position
(0, 0)
forSurface.blit
, thanks to @damusss in #2936. - @itzpr3d4t0r added a new function
Surface.premul_alpha_ip
to premultiply alpha faster by operating in place instead of needing to allocate a new Surface. @Matiiss also helped with documentation. See #2899, #2972, and #2980.
Bugfixes
- @Matiiss fixed passing
parent_window=None
todisplay.message_box
in #2723. - @itzpr3d4t0r fixed an issue
transform.hsl
not working on certain pixel formats in #2948. - @oddbookworm fixed a
Surface.fill
where rects with negative positions would slide to(0, 0)
and then fill, instead of only filling part of theRect
. See #2939 for details. - @ankith26 fixed using
SCALED
after not usingSCALED
indisplay
in #2925. - @damusss fixed using OpenGL with a resizable
pygame.Window
, see #2915.
General Enhancements
- @MyreMylar added a SIMD printout (SSE2, AVX2 & NEON) to
pygame.print_debug_info()
in #2897. This will help us debug any SIMD-backend specific bugs submitted by users. - @damusss added support for
radius = 0
circles to the experimentalgeometry
module, see #2913. - @zoldalma999 added new
"ABGR"
format support toimage.frombytes
andimage.tobytes
in #2951. - @zoldalma999 made the experimental
Window
class subclassable in #2950. - @ankith26 added support for iterables in
display.update
, see #2987. - @Starbuck5 and @ankith26 added Python 3.13 support in #2994 and #3030.
Performance Enhancements
- @itzpr3d4t0r continued his quest to optimize all the things, merging improvements to
PixelArray.make_surface
,transform.scale2x
,Surface.fblits
(a fix for a performance regression),mask.from_surface
and(F)Rect
methods. See #2953, #2859, #2978, #2895, and #2908 for more details. - @mzivic7 got a 5-6% boost out of
draw.aacircle
(new in pygame-ce 2.5.0) in #3012. - @Starbuck5 boosted the performance of some
draw
operations on 24-bit surfaces, with a 20% improvement on single-pixel line drawing, see #3021.
Deprecations and Removals
No new deprecations this release, but-
- @ankith26 added deprecation warnings to some already-deprecated API (
freetype.was_init
,scrap.lost
) in #3001.
Docs and Type Hints
- @Mega-JC created a new logo and added it to the docs (in collaboration with @kadir014 on the design), in #2965. This is great for us to express our own identity as a project.
- @REX2626, @whangho, @Mic-lab, and @damusss made grammar and wording improvements to docs content. See #2907, #2919, #2911, #3004, and #2901.
- @damusss made it so deprecated functions are marked with the deprecated decorator in #2984. This allows editors to show users that a function is deprecated very neatly. They also made some smaller enhancements to the type stubs in #2918 and #2926.
- @ankith26 modernized the stubs to use python-3.8-isms in #2995
- @MrF1ow added a Contribution Section to README to help out new contributors in #2910.
- @MyreMylar added license identifier to README in #2890.
- @oddbookworm changed dark theme slightly to make code more readable in some cases in #2960.
Examples and Unit Tests
- @bilhox made some general example changes and enhancements in #2581.
- @ankith26 and @MyreMylar enhanced our unit tests and ensured sure they keep passing in #3031, #3017, #2934, #2885, and #2966.
Code Quality and General Maintenance
- @Notenlish got rid of unneeded
docscomments.js
usage in docs in #2959. - @ankith26 added support for macOS arm64 PyPy in our releases in #2945. He also improved our buildconfig/CI by making it more robust and secure in #2971, #2977, #3015, #2941, and #3040.
- @Starbuck5 helped keep our codebase modern and tidy in #2922, #2940, #2928, #3014, #2973, #2974, and #3020.
- @oddbookworm made some ease-of-use changes to doc generation in #2942 and #2989.
- @zoldalma999 updated the codebase to use the
SDL_TTF_VERSION_ATLEAST
macro in #3003. - @ankith26 and @zoldalma999 made some changes to better support development "editable" builds in #2996 and #2952.
- @Matiiss and @oddbookworm ensured our SDL dependency is kept updated in #2949, #2969, and #3034.
- @dependabot kept all our CI dependencies updated in #2906, #2932, #2931, #2930, #2955, #2963, #2964, #2983, #2982, #3013, #3025, and #3024.
- @Starbuck5 and @ankith26 worked on making intermediate dev releases possible in #2905, #3038, and #3039.
New Contributors
- @REX2626 made their first contribution in #2907.
- @MrF1ow made their first contribution in #2910.
- @whangho made their first contribution in #2919.
- @Mic-lab made their first contribution in #3004.
Thanks all
A heartfelt thank you to everyone involved! This includes not just code contributors, but also the wider community - issue reporters, PR reviewers, tutorial creators, helpers on various media platforms, developers of supp...
2.5.1.dev2
A pre-release before the final release, please help us by testing this!
Release highlights
This is mostly a bug-fixes-and-enhancements release, but we do have a few cool new stuff to showcase!
- We now support and distribute wheels for CPython 3.13 and PyPy for apple silicon.
- The experimental
Window
class is now subclass-able. - Added new method
Surface.premul_alpha_ip
- The
dst
argument ofSurface.blit
now has a default value:(0, 0)
. This means you can skip this argument if you are blitting a surface at the origin (top-left) of the window.
What's Changed
- 2.5.0.dev5 by @Starbuck5 in #2904
- Start 2.5.1 by @Starbuck5 in #2905
- Bump docker/login-action from 3.1.0 to 3.2.0 by @dependabot in #2906
- Update docs of
Surface.get_(f)rect()
and(F)Rect.move_to()
by @damusss in #2901 - Fixed missing comma in README by @REX2626 in #2907
- Add SSE2, AVX2 & NEON support to
pygame.print_debug_info()
by @MyreMylar in #2897 - Use github download links to get SDL dependencies by @ankith26 in #2916
- Update transform.get/set_smoothscale_backend typehint from str to Literal by @damusss in #2918
- Contribution Section Added to README.rst by @MrF1ow in #2910
- Update punctuation in some docs by @whangho in #2919
- More SDL3 compat: Surface things by @Starbuck5 in #2922
- Very small typehint fix for pygame.Mask by @damusss in #2926
- Remove SDL v1.2.10 checks in display.c by @Starbuck5 in #2928
- pygame.Surface docs improvements by @REX2626 in #2911
- Bump docker/build-push-action from 5.3.0 to 5.4.0 by @dependabot in #2932
- Fix failing tests based on numpy v2 by @ankith26 in #2934
- Bump actions/checkout from 4.1.6 to 4.1.7 by @dependabot in #2931
- Bump pypa/cibuildwheel from 2.18.1 to 2.19.1 by @dependabot in #2930
- EventState SDL3 compat by @Starbuck5 in #2940
- Try re-enabling tests disabled since SDL 2.0.18 by @MyreMylar in #2885
- Fix passing
parent_window=None
tomessage_box
by @Matiiss in #2723 - Improve security of releases by adding hash checks by @ankith26 in #2941
- Updated SDL to 2.30.4 by @Matiiss in #2949
- Fix transform.hsl() to work on any Surface by @itzpr3d4t0r in #2948
- Bump docker/build-push-action from 5.4.0 to 6.1.0 by @dependabot in #2955
- Allow degenerate circles (radius = 0) by @damusss in #2913
- Improve
PixelArray.make_surface()
performance by @itzpr3d4t0r in #2953 - Fix
Surface.fill
with rects with negative positions that overlap the surface by @oddbookworm in #2939 - Add ABGR format to frombytes and tobytes by @zoldalma999 in #2951
- Make window subclassable by @zoldalma999 in #2950
- Optimized
transform.scale2x()
by @itzpr3d4t0r in #2859 - Use static inline instead of inline by @zoldalma999 in #2952
- Add default dest (0, 0) to Surface.blit by @damusss in #2936
- Docs generation is now
python -m buildconfig docs
andpython -m buildconfig docs full_generation
by @oddbookworm in #2942 - Bump docker/build-push-action from 6.1.0 to 6.2.0 by @dependabot in #2963
- Bump robinraju/release-downloader from 1.10 to 1.11 by @dependabot in #2964
- Add
Surface.premul_alpha_ip()
by @itzpr3d4t0r in #2899 - SDL 2.30.5 by @oddbookworm in #2969
- Make pyproject license consistent with
setup.py
by @ankith26 in #2971 - Fix
premul_alpha_ip
doc indentation issue by @Matiiss in #2972 - Add new official logos for pygame - Community Edition by @Mega-JC in #2965
- Fix homepage and release notes link in pypi urls by @ankith26 in #2977
- Use PyObject_CallMethod in resource loaders by @Starbuck5 in #2974
- Get rid of docscomments.js from docs by @Notenlish in #2959
- Remove obsolete surflock functions by @Starbuck5 in #2973
- Bump docker/build-push-action from 6.2.0 to 6.3.0 by @dependabot in #2983
- Ensure
.premul_alpha_ip()
works with zero sized Surfaces by @itzpr3d4t0r in #2980 - Bump pypa/cibuildwheel from 2.19.1 to 2.19.2 by @dependabot in #2982
- Restore inlining for
.fblits()
internal functionality by @itzpr3d4t0r in #2978 - Optimized
mask.from_surface()
when converting an alpha surface. by @itzpr3d4t0r in #2895 - Fix scaled-after-non-scaled usage by @ankith26 in #2925
- Optimized all
Rect/FRect
methods viapgRect_FromObject
by @itzpr3d4t0r in #2908 - General example changes by @bilhox in #2581
- python -m buildconfig now works again... by @oddbookworm in #2989
- Use python 3.8 isms in the type stubs by @ankith26 in #2995
- Add license identifier to readme by @MyreMylar in #2890
- Polish stubs with deprecated decorator by @damusss in #2984
- Make deprecated API raise deprecation warnings by @ankith26 in #3001
- Use
SDL_TTF_VERSION_ATLEAST
by @zoldalma999 in #3003 - Make blend flag docs more accurate by @Mic-lab in #3004
- Fix editable install test fixtures logic by @ankith26 in #2996
- Support iterable in
display.update
by @ankith26 in #2987 - 3.13 source support (removes deprecated functions) by @Starbuck5 in #2994
- Centralize CI config and make it more uniform (Adds macOS arm64 pypy CI) by @ankith26 in #2945
- Optimize draw.aacircle and fix typo by @mzivic7 in #3012
- Pin all build dependencies by @ankith26 in #3015
- Bump docker/build-push-action from 6.3.0 to 6.4.1 by @dependabot in #3013
- Skip flaky window tests on pypy by @ankith26 in #3017
- Adjust tobytes premul formula by @ankith26 in #2966
- Update OpenGL Viewport when Window resizes by @damusss in #2915
- Use PyObject_CallNoArgs where applicable by @Starbuck5 in #3020
- Changed dark theme slightly to make code more readable in some cases by @oddbookworm in #2960
- Remove unnecessary pixeloffset member of subsurface data by @Starbuck5 in #3014
- draw.c: better strategy for 24bpp writes by @Starbuck5 in #3021
- Bump docker/login-action from 3.2.0 to 3.3.0 by @dependabot in #3025
- Bump docker/build-push-action from 6.4.1 to 6.5.0 by @dependabot in #3024
- Update SDL to 2.30.6 by @oddbookworm in #3034
- Skip yet another flaky pypy test by @ankith26 in #3031
- Add python 3.13 wheel support by @ankith26 in #3030
New Contrib...
2.5.0
☀️🌊🏖️😎🏄🐚🌈🏝️🍹☀️🌊🏖️🎉
pip uninstall pygame
(if previously installed, to avoid package conflicts)
pip install pygame-ce --upgrade
☀️🌊🏖️😎🏄🐚🌈🏝️🍹☀️🌊🏖️🎉
This release, coming in just four months after the previous one, has been possible due to patches submitted by over 30 contributors, who have collectively made over 132 pull requests with 464 commits that touch 413 files! Impressive!
Now, onto the highlights!
Highlights
API updates
- added
mouse.get_just_[pressed|released]
in #2836 - added
display.[get|set]_window_position
in #2816 (F)Rect
can be initialized with no arguments in #2655
@whydoubt added the pitch
argument for image.tobytes
in #2602
@XFajk added Color.from_normalized
constructor and Color.normalized
property in #2693
@mzivic7 added draw.aacircle
in #2800
@itzpr3d4t0r added transform.hsl
in #2398
@ScriptLineStudios implemented a few convenience properties to Surface
class: Surface.width
, Surface.height
and Surface.size
in #2813
@bilhox added math.invlerp
and math.remap
in #2654
@ankith26 added mixer.get_driver
in #2741
SIMD Performance enhancements
@Starbuck5 improved performance of SSE2 no_surf_alpha_opaque_dst
blitter in #2601 and #2896. As a result of this PR, some kinds of blit operations should get a nice speed up (upto about 2.5x speedup on the testcases we used) on some hardware.
- Partially refactor SSE2 blitters with macros in #2656.
- Implemented AVX2 variant of
Surface.premul_alpha
in #2615
@MyreMylar added SIMD versions transform.invert
in #2534. This gives a significant performance boost, and in the example we tested, we have observed a 12x-13x speedup!
More pygame.geometry
goodies
The recently introduced experimental pygame.geometry
submodule has gotten more features and polish in this release in the PRs: #2561, #2660, #2634, #2662, #2661, #2709, #2791, #2732, #2731
A big thanks to everyone who contributed to pygame-geometry so far: @Emc2356, @itzpr3d4t0r, @novialriptide, @ScriptLineStudios, @avaxar, @gresm, @Matiiss, @newpaxonian, @maqa41, and @blankRiot96
As with all experimental submodules, do remember that things in here are subject to change, and there are a lot more things to be added! See the docs for the current progress.
Other general highlights
@oddbookworm added opengl
support to the experimental pygame.Window
interface in #2659
@ankith26 added Wayland and PipeWire support in the linux wheels distributed by us in #1997 and #2733
@ankith26 rewrote the build machinery in the meson
buildsystem, while deprecating the old build machinery in the PRs #2557, #2803, #2853, #2856, #2875, #2854, #2831, #2779. As part of these changes, a few improvements are:
- On 32-bit ARMv7 systems (which includes many Raspberry Pi), NEON (SIMD) optimizations are now enabled by default. Therefore users of this should see a significant performance boost in many operations that can support SIMD.
- Enhanced support for Windows MinGW/MSYS2 systems.
- Reduced wheel size.
Deprecations and Removals
@Starbuck5 removed the pygame.threads
submodule in #2762
@oddbookworm re-added and properly deprecated the blend
argument of draw.aaline
in #2743
Performance Enhancements
In addition to those mentioned above that are SIMD-related
- Optimized
(F)Rect.unionall(_ip)
in #2784 - Optimized
(F)Rect.collideXX
family of methods in #2786 - Replaced use of internal C-API functions with more efficient alternatives in #2819
Bug fixes
@oddbookworm added shim to fix broken midi
module compilation in #2863
- fixed some init related issues in the experimental
window
API in #2860 - fixed segmentation fault during invalid
PixelArray
usage in #2742
General Enhancements
@Kn4ughty made error messages for using font
align clearer in #2777
@pmp-p ensured we keep supporting pygame on the web in
- wasm: unify pygame-web/pyodide/static Freetype init in #2748
- fixed some
METH_NOARGS
arg missing in #2888
- made
transform
blur on a surface with either width or height equal to 0 not raiseValueError
in #2852 - Cleanup codebase, docs and examples with American spelling in #2827
@Starbuck5 added a briefcase
template to pygame-ce in #2862
@RainRat fixed typos across the repository in #2847
@robertpfeiffer relax Surface.convert
conditions in #2839, now it is no longer a requirement to have called display.set_mode
when this method has been invoked with a
@oddbookworm removed the xwayland warning and ensured that debug info now contains whether x11 is running or xwayland in #2823
Examples and Unit tests
@snowfruit added an example for retro scaling in #2785
@Matiiss removed undefined variable in aliens.py
in #2769
@Starbuck5 fixed ftfont_test
being run directly in #2763
- Add a delta of 2 ms to test_music_pause__unpause() in #2898
- Force window surface update after set_size, hopefully proper fix for that pesky frequent pypy test fail in #2865
- Minor changes to support pytest in #2675
Docs, Tutorials and typestubs
- fixed documentation mix up in attributes of object returned by
get_power_state
in #2734 - added clarifications about ranges in
mixer
docs in #2738
@kritserv fixed an issue in pygame.display.get_caption
docs in #2765
@yohanmoon added instructions for resolving setuptools issue in the docs readme in #2868
@Matiiss added more /
(positional-only notation) to docs and stubs in #2691
@oddbookworm fixed indentation of surface attributes in #2900
@ankith26 did some minor docs/stubs improvements in invlerp
/remap
in #2902
@Starbuck5 added warning about 7.1 stereo on set_source_location
in #2881
- removed duplicate images in tutorials in #2871
- including
print_debug_info()
in issue template in #2879 - adjusted symbol color in light theme in #2891
Code quality and robustness
- Minor optimizations by using comprehensions in #2771
- PEP572 Use Python's assignment expression in #2782
- Remove lint logic from
setup.py
in #2796 setup.py
: Properly add_sdl2_data_files
todata_files
in #2770
@Lumiobyte fix a comment typo...
2.5.0.dev4
This is a pre-release for 2.5.0.
Highlights
- New functions for surfaces:
draw.aacircle()
andtransform.hsl
. Surfaces also have new attributesSurface.width
,Surface.height
andSurface.size
. - New window positioning API for pygame.display.
pygame.display.get/set_window_position()
- New math functions
math.invlerp
andmath.remap
- OpenGL support for the experimental Window class
- See the highlights of 2.5.0.dev2 as well: https://github.com/pygame-community/pygame-ce/releases/tag/2.5.0.dev2
What's Changed
- 2.5.0.dev2 by @Starbuck5 in #2817
- Bump to 2.5.0.dev3 by @ankith26 in #2818
- Bump actions/checkout from 4.1.2 to 4.1.3 by @dependabot in #2814
- Minor optimizations by using comprehensions by @cclauss in #2771
- Remove use of Py_BuildValue("(ii)") by @itzpr3d4t0r in #2819
- Cleanup codebase, docs and examples with American spelling by @Damus666 in #2827
- Unify freetype init codepaths by @Starbuck5 in #2801
- xwayland warning removed; documented; and debug info now contains whether x11 is running or xwayland by @oddbookworm in #2823
- Remove lint logic from setup.py by @cclauss in #2796
- Track version only in pyproject.toml by @ankith26 in #2820
- Bump actions/checkout from 4.1.3 to 4.1.4 by @dependabot in #2833
- Try sleeping in window autoresize test by @MyreMylar in #2832
- Use HasColorKey instead of GetColorKey in pgSurface_Blit by @Starbuck5 in #2835
- Updated SDL to 2.30.3 by @oddbookworm in #2837
- Simple SDL3 patches for freetype, surface, mouse by @Starbuck5 in #2838
- Format Python code with ruff format instead of black by @cclauss in #2824
- Bump gh actions mac runners (gets us native M1 builds) by @ankith26 in #2494
- Add explicit check and error for system cursor by @ankith26 in #2843
- Always call HasColorKey before GetColorKey by @Starbuck5 in #2844
- Remove cython gen files, generate in meson build by @ankith26 in #2831
- Optimized ( Rect/Frect ) unionall()/unionall_ip() by @itzpr3d4t0r in #2784
- PixelArray raise error assigning sequence to pixel by @ankith26 in #2742
- Bump actions/checkout from 4.1.4 to 4.1.5 by @dependabot in #2851
- fix typos by @RainRat in #2847
- Fix pylint undefined usage error in sysfont by @ankith26 in #2858
- Add pygame.mouse.get_just_pressed/released() by @Damus666 in #2836
- Bump actions/checkout from 4.1.5 to 4.1.6 by @dependabot in #2861
- Using blur on a surface with either width or height equal to 0 won't raise a ValueError by @Damus666 in #2852
- Simplified SIMD fill algorithms by @itzpr3d4t0r in #2793
- Bundle only the required pygame icon files by @ankith26 in #2854
- add instruction for
ModuleNotFoundError: No Module named setuptools
by @yohanmoon in #2868 - Deprecate
setup.py stubcheck
, suggest and use replacementbuildconfig/stubs/stubcheck.py
by @ankith26 in #2856 - Run display autoinit on window API, fixes by @ankith26 in #2860
- Force window surface update after set_size, hopefully proper fix for that pesky frequent pypy test fail by @ankith26 in #2865
- Surface properties by @ScriptLineStudios in #2813
- relax convert conditions by @robertpfeiffer in #2839
- Added shim to fix portmidi break by @oddbookworm in #2863
- Alter CODEOWNERS file to switch required PR review team by @MyreMylar in #2873
- Deprecate
setup.py docs
, make docs in meson build by @ankith26 in #2853 - Remove duplicate images in tutorials by @MyreMylar in #2871
- Add Circle
contains()
by @itzpr3d4t0r in #2791 - Bump pypa/cibuildwheel from 2.17.0 to 2.18.1 by @dependabot in #2874
- Minor changes to support pytest by @ankith26 in #2675
- Window(opengl=True) will now create an OpenGL context by @oddbookworm in #2659
- Add pygame.display.get/set_window_position() by @Damus666 in #2816
- draw.aacircle() by @mzivic7 in #2800
- Update mixer docs by @lispspb in #2738
- Add a briefcase template to pygame-ce by @Starbuck5 in #2862
- including
print_debug_info()
in issue template by @MyreMylar in #2879 - Add warning about 7.1 stereo on set_source_location by @Starbuck5 in #2881
- fix some METH_NOARGS arg missing by @pmp-p in #2888
- Fix
python -m docs
dev time convenience command by @ankith26 in #2889 - Add
transform.hsl()
by @itzpr3d4t0r in #2398 - Adjust symbol color in light theme by @MyreMylar in #2891
- Deprecate
setup.py sdist
, suggest and use replacement pypa/build based command by @ankith26 in #2875 - Add missing check in SSE2 alpha blitter by @Starbuck5 in #2896
- Add a delta of 2 ms to test_music_pause__unpause() by @MyreMylar in #2898
invlerp
andremap
implementation by @bilhox in #2654- fixed indentation of surface attributes by @oddbookworm in #2900
- Minor docs/stubs improvements in
invlerp
/remap
by @ankith26 in #2902
New Contributors
- @RainRat made their first contribution in #2847
- @yohanmoon made their first contribution in #2868
- @mzivic7 made their first contribution in #2800
Full Changelog: 2.5.0.dev2...2.5.0.dev4
2.5.0.dev2
This is an early pre-release for 2.5.0, we expect to also do a dev4
before the full release.
Highlights
- More performance optimizations: Faster blitters in some cases, faster
Surface.premul_alpha
, fastertransform.invert
, faster "multi-collide"Rect
methods (likeRect.collidelist
). - Incremental progress in
pygame.geometry
, more methods added to classes. - Wayland and PipeWire support on linux wheels we distribute.
- Switched to the Meson build system (keeps us modern). As part of this we expect SIMD support by default on 32-bit ARM systems (like some Raspberry Pi).
Other API updates
- Added
from_normalized()
method toColor
. pitch
argument implemented inimage.tobytes()
.Rect()
andFRect()
now support initialization with no arguments.
What's Changed
- Start 2.5.0 by @Starbuck5 in #2631
- Bump docker/metadata-action from 5.3.0 to 5.4.0 by @dependabot in #2628
- Call
PyObject_GetBuffer
directly, fix pypy fail by @ankith26 in #2639 - Add Circle
move()
/move_ip()
by @itzpr3d4t0r in #2561 - Improve performance of SSE2 no_surf_alpha_opaque_dst blitter by @Starbuck5 in #2601
- Fix comment typo in rect_impl.h by @Lumiobyte in #2658
- Fix
Circle
move docs by @itzpr3d4t0r in #2660 - Remove shuffle masks in AVX fillers by @itzpr3d4t0r in #2642
- Matiiss update sdl ttf by @Matiiss in #2687
- Fix error reporting sdl 2.29.2+ by @Matiiss in #2689
- Bump actions/cache from 3.3.3 to 4.0.0 by @dependabot in #2683
- Added more
/
(positional-only notation) by @Matiiss in #2691 - Reduced redundancy in
surface.fblits
code and handled generator exception by @Matiiss in #2679 - Rect() and FRect() initialization with no arguments by @Damus666 in #2655
- added from_normalized() and get and set normalized methods for pygame.Color by @XFajk in #2693
- Partially refactor SSE2 blitters with macros by @itzpr3d4t0r in #2656
- SDL 2.30.0 by @oddbookworm in #2705
- SDL 2.29.3 pre-release by @Matiiss in #2690
- Implement pitch argument for image.tobytes() by @whydoubt in #2602
- transform.scale: softstretch SDL2/SDL3 compat by @Starbuck5 in #2707
- Add missing geometry versionadded tags by @itzpr3d4t0r in #2709
- SDL2/SDL3 mutex support by @Starbuck5 in #2712
- Add Circle
as_rect()
/as_frect()
by @itzpr3d4t0r in #2634 - Add Circle
rotate()
/rotate_ip()
by @itzpr3d4t0r in #2662 - Add Circle
collideswith()
by @itzpr3d4t0r in #2661 - Bump CircleCI-Public/trigger-circleci-pipeline-action from 1.1.0 to 1.2.0 by @dependabot in #2730
- Deleted a space in geometry docs by @itzpr3d4t0r in #2732
- Update system.rst by @lispspb in #2734
- Cleanup rwobject.c file object methods by @Starbuck5 in #2717
- Add wayland and kmsdrm support to manylinux wheels by @ankith26 in #1997
- Bump actions/cache from 4.0.0 to 4.0.1 by @dependabot in #2736
- Formatting updates using newest version of clang-format by @oddbookworm in #2744
- Bump docker/build-push-action from 5.1.0 to 5.2.0 by @dependabot in #2747
- Bump softprops/action-gh-release from 1 to 2 by @dependabot in #2746
- wasm: unify pygame-web/pyodide/static Freetype init by @pmp-p in #2748
- Reorganize geometry internals by @itzpr3d4t0r in #2731
- Undeprecate draw aaline blend by @oddbookworm in #2743
- AVX2 premul_alpha() by @itzpr3d4t0r in #2615
- Bump docker/login-action from 3.0.0 to 3.1.0 by @dependabot in #2755
- Bump docker/build-push-action from 5.2.0 to 5.3.0 by @dependabot in #2756
- Bump actions/checkout from 4.1.1 to 4.1.2 by @dependabot in #2754
- Add
mixer.get_driver
by @ankith26 in #2741 - Add pipewire and libsamplerate+fftw3 by @ankith26 in #2733
- SDL 2.30.1 by @Starbuck5 in #2761
- Fix
pygame.display.get_caption()
Docs in display.rst by @kritserv in #2765 - Bump actions/cache from 4.0.1 to 4.0.2 by @dependabot in #2767
- setup.py: Properly add _sdl2_data_files to data_files by @cclauss in #2770
- Update freetype download link because current one is broken (fixes failing circleci builds) by @ankith26 in #2774
- Remove undefined variable in aliens.py by @Matiiss in #2769
- Fix ftfont_test being run directly by @Starbuck5 in #2763
- Remove pygame.threads by @Starbuck5 in #2762
- Make error messages for using font.align clearer by @Kn4ughty in #2777
- Remove apt upgrade in CI by @ankith26 in #2778
python3 setup.py lint
is deprecated: Let's lint withpre-commit
by @cclauss in #2772- Add example for retro scaling by @snowfruit in #2785
- PEP572 Use Python's assignment expression by @cclauss in #2782
- Remove all .editorconfig duplicates, re-add in project root with updates by @ankith26 in #2788
- Add SIMD versions of the invert transform by @MyreMylar in #2534
- Remove docs non-public module stubs by @ankith26 in #2794
- Add meson build system [phase 1] by @ankith26 in #2557
- (Freetype) use calloc where possible by @Starbuck5 in #2802
- Bump robinraju/release-downloader from 1.9 to 1.10 by @dependabot in #2809
- SDL 2.30.2 by @Starbuck5 in #2806
- gitignore meson temp folder by @Starbuck5 in #2805
- Fix sdist to include meson stuff and minor updates by @ankith26 in #2803
- build-on-msys2.yml: Upgrade GitHub actions/checkout@v4 by @cclauss in #2812
- Use macros for (Bytes|Bits)PerPixel compat in SDL3 by @Starbuck5 in #2804
- Add armv6 and armv7 to multiarch CI and fix build issues by @ankith26 in #2779
- Optimized Rect multi-collision methods by @itzpr3d4t0r in #2786
New Contributors
- @Lumiobyte made their first contribution in #2658
- @XFajk made their first contribution in #2693
- @whydoubt made their first contribution in #2602
- @lispspb made their first contribution in #2734
- @kritserv made their first contribution in #2765
- @cclauss made their first contribution in #2770
- @Kn4ughty made their first contribution in #2777
- @snowfruit made their first contribution in #2785
Full Changelog: 2.4.1...2.5.0.dev2
2.4.1
🎩⚓📺💽🦾🎩⚓📺💽🦾🎩⚓📺💽🦾
pip uninstall pygame
(if previously installed, to avoid package conflicts)
pip install pygame-ce --upgrade
🎩⚓📺💽🦾🎩⚓📺💽🦾🎩⚓📺💽🦾
Hello! This is a smaller release focused on bugfixes and small updates that we've developed on the course to 2.5.0. Rather than waiting for 2.5.0 to get these out into the world, we're doing this release to get bugfixes and small updates out into the world as soon as possible.
Special thanks to all our contributors and reviewers. Check out the changes!
Bugfixes
- @Starbuck5 Fixed a
2.3.0
regression wheresysfont
wouldn't provide real bold/italic fonts. (Thanks @RasmusTufvesson for reporting this). #2678 - @Starbuck5 Fixed a rare bug involving
libpng16-16.dll
. #2674 - @Matiiss Fixed a segfault that could be triggered in
Surface.fblits
. #2667 - @gresm Changed local docs viewing (
python -m pygame.docs
) to launch a webserver on Linux, to get around permissions issues with some Linux environments. This can be accessed explicitly aspython -m pygame.docs.serve
. #2676 - @pmp-p Fixed the webassembly build setup. #2653
- @Matiiss Fixed a memory leak in
Renderer.to_surface
. #2665
Dependencies
- @Matiiss updated the build to
SDL_ttf 2.22.0
(fixing an issue where"\n\n"
would segfault multiline-rendering). #2688 - @ankith26 updated the build to
SDL_mixer 2.8.0
(adding support forwavpack
music/sound). #2703 - @Starbuck5 updated the build to
SDL_image 2.8.2
(also fixing a rare bug involving libpng, mentioned earlier). #2674
Documentation and examples
- @Matiiss updated the bug report template. #2669
- @Matiiss improved the Window.flip error message when no surface is associated with the Window. #2633
- @Matiiss furthered deprecation of deprecated sprite groups. #2666
- @szabolcsdombi Fixed documentation of a Window parameter name (allow_highdpi -> allow_high_dpi). #2704
- @itzpr3d4t0r Added more links to the
special_flags
page. #2708 - @oddbookworm removed use of the
display
depth parameter in examples. #2644
CI and tests
- @MyreMylar kept the CI running error-free by adjusting to a Python 3.12.2 change. #2715
- @ankith26 improved test resiliency and coverage. #2640, #2641, #2647
- @Starbuck5 fixed code formatting for latest black version. #2697
- @dependabot kept github actions up to date. #2612, #2613, #2663, #2671, #2701, #2700, #2702, #2710
New contributors
- @szabolcsdombi made their first contribution in #2704
Community showcase
Clear Code released a new pygame tutorial meant specifically for pygame-ce
, check it out: https://www.youtube.com/watch?v=WViyCAa6yLI
Full Changelog: 2.4.0...2.4.1
2.4.0 - The happy new year release
☀️🏫🎊🏡🎆🏠🕛🏫🌈🎄🏩🏪🎇🏠🎉🏡🪅
pip uninstall pygame
(if previously installed, to avoid package conflicts)
pip install pygame-ce --upgrade
☀️🏫🎊🏡🎆🏠🕛🏫🌈🎄🏩🏪🎇🏠🎉🏡🪅
Happy new year! And with that, hello and welcome to yet another release of pygame-ce
!
In about 4 months since the last release, this release has seen 36 contributors make over 150 pull requests and 606 commits with 81,203 line additions and 88,026 line deletions across 375 files! Wow!
The 2.4.x series drops support for Python 3.7, which has reached EOL. If you are still using this, consider upgrading to a newer Python version!
Special thanks to all our new (and returning after a while) contributors. Check out the changes!
Notable changes
🟢 A new experimental geometry
submodule with a Circle
class
A new submodule is making its way to pygame, how exciting!
The pygame_geometry
project started with the purpose of helping users integrate special colliders more easily, by providing implementations for things like polygons, circles, lines, and raycasting. This submodule is still in early development and is very much experimental, but is set to slowly make its way into pygame-ce
over the next couple of releases.
A big thanks to everyone who contributed to pygame-geometry
so far: @Emc2356, @itzpr3d4t0r, @novialriptide, @ScriptLineStudios, @avaxar, @gresm, @Matiiss, @newpaxonian, @maqa41 and @blankRiot96
Parts of the submodule were ported bit by bit in the PRs #2268, #2562, #2560, #2614, #2540, #2536, #2519 and #2545
As with all experimental submodules, do remember that things in here are subject to change, and there are a lot more things to be added! See the docs for the current progress.
🚀 More SIMD-based performance enhancements
Did you know pygame-ce uses optimized assembly? We use single instruction, multiple data (SIMD) instructions to speed up operations with lots of parallel computations. In this release, we've used this to increase performance of several transform
and Surface
operations (with more to come in future releases). These optimizations target Intel/AMD and ARM architectures.
- @MyreMylar added an optimized backend for
transform.greyscale
through #2421 and #2432. Expected speedup: 7x for ARM/old x86 computers. 11x for x86 computers that support AVX2. - @itzpr3d4t0r worked on speeding
Surface.fill
when used with blend flags in #2566, #2382 and #2565. Expected speedup: Ridiculously faster, like 50-100x faster - @Starbuck5 added a new optimized backend for
transform.smoothscale
in #2473 and #2544. Expected speedup: 15% faster on x86, 35% faster on ARM.
🪟 Improvements to the experimental Window class
A lot of nice work went behind the experimental Window
class in this release. The Window
class enables controlling multiple windows, and enables cool new windowing features over the pygame.display
API. This is important because we hope the Window
API exits experimental status soon! See the docs for the current progress.
- @Matiiss added the
[min|max]imum_size
properties in #2364 - @novialriptide fixed a segmentation fault when destroying window in #2530
- @yunline and @Starbuck5 created a new way to manage display surfaces with Window, adding the
get_surface
andflip
methods and deprecatingfrom_display_module
. #2350, #2575, #2577, #2624. - @yunline added some unit tests in #2230
- @yunline did a
grab
API rework in #2379 and #2520 - @yunline added
mouse_rect
in #2564 - @Starbuck5 worked to improve the documentation and remove extraneous/questionable bits of the API. #2617, #2618, #2627.
- @Starbuck5 made the Window class available as
pygame.Window
in #2604 and #2607.
API Changes
New API
key.get_just_[pressed|released]
(check key status without event loop) by @ScriptLineStudios in #1912[F]Rect.move_to
by @Matiiss in #2165math.lerp
andmath.smoothstep
by @robertpfeiffer in #2254mixer.Channel.id
by @oddbookworm in #2369image.load_sized_svg
(scale as vector before loading into Surface) by @ankith26 in #2620mouse.[get|set]_relative_mode
by @yunline in #2076system.get_power_state
(battery info!) by @yunline in #2257display.message_box
(for alerts) by @yunline in #2427
Updated API
- @yunline improved subpixel rendering (float coordinates) for
_sdl2.video.Texture
and_sdl2.video.Renderer
in #2039 - @yunline added support for
int
/str
color values in_sdl2.video
module in #2400 - @gresm added and improved support for subclassing
mixer.Sound
andmixer.Channel
in #2590 - @oddbookworm added keyword argument support to
Rect.collidedict[all]
in #2309 - @oddbookworm did some changes to allow
clamp_magnitude
ing of the zero vector when possible in #2598 - @Starbuck5 updated our build to use SDL_image 2.8.0, which adds support for
QOI
images, in #2595.
Removals and deprecations
- @MightyJosip and @MyreMylar removed deprecated
blend
argument fromdraw.aaline[s]
in #2506 and #2550 respectively. - @MyreMylar removed the cythonised
_sprite
module in #2546. For now, a compat shim is provided, but its usage is deprecated. - @zoldalma999 deprecated the
depth
argument ofdisplay.set_mode
in #2490 - @Starbuck5 deprecated the old backends of
transform.smoothscale
in #2583
Performance enchancements
In addition to those mentioned above that are SIMD-related
- @Starbuck5 optimized vector argument parsing in #2443, so
Vector
methods that operate on anotherVector
(likemove_towards
) are now ~10% faster. - @itzpr3d4t0r made many
[F]Rect
methods implement the FASTCALL convention in #2043, #2563 and #2570. All the updated functions should now work faster! - @Matiiss and @itzpr3d4t0r optimized hadling of
[F]Rect
arguments in #2041 and #2465.
Bug fixes
- @dr0id added checks to disable font API usage when the subsystem is not initialized in #2371
- @oddbookworm fixed an underflow issue in
tick_busy_loop
in #2466 - @Damus666 did some WASM related fixes in
display
,math
andcolor
submodules in #2480 and #2482 (by adding required PyObject *_null parameter to functions marked with METH_NOARGS) - @pmp-p fixed a WASM loader incorrect target issue in #2586
- A team of new contributors: @igordsm, @JorasOliveira, @Antonioarf, @jpgianfaldoni, @caioesr, @cicerotcv and @nataliaqmc fixed a colorkey issue in
transform.rotozoom
in #2491 - @yunline fix a segfault in the
update
method of_sdl2.video.Texture
in #2553 - @ankith26 fix file-like
close
not called infreetype.Font
in #2606 - @Temmie3754 fixed incorrectly drawn edges in
draw.polygon
in #2131 - @Temmie3754 fixed
gfxdraw.bezier
for when there are a lot of points in #2503 - @MyreMylar fixed a segfault when passing empty
StringIO
/File
objects toFont
in #2548 - @MyreMylar fixed RLE related issues in the
transform
module in #2535 - @MyreMylar prevented an unnecessary warning from being raised when using
SysFont
and the default font in #2543 - @Starbuck5 implemented a fix for windows webcams that don't report framerate crashing
pygame.camera
in #2574 - @Starbuck5 fixed
image.get_sdl_image_version
incorrectly handling thelinked
argument in #2597
Test and examples related improvements
- @dr0id corrected a typo in
Rect
test methods in #2359 - @Matiiss added a
mixer
test skip because it randomly fails on Linux in #2438 - @zoldalma999 removed
test
tests in #2475 - @JorasOliveira added tests to
Surface.get_(f)rect
in #2492 - @gresm added more multiline examples in #2588
- @KentAugust added multiplayer joystick example in #2524
- @bilhox updated
video
example to use the newpygame.display.message_box
in #2572 - @llindstrom updated the
go_over_there
example for Python 3.12 in #2521 - @ankith26 made some freetype tests run on CI and fixed a minor test fail in #2370
- @ankith26 added tests for PBM, LBM and XCF images, and also updated some docs in #2608
Docs and typing related enhancements
- @itzpr3d4t0r improved
Surface.blit[s]
docs in #2262 and #2263 - @zoldalma999 remove mentions of
overlay
module in #2411 - @bilhox updated the French README in #2228
- @oddbookworm did some minor
sprite
doc fixes in #2423 - @sweatshirtwearingviper corrected a
sprite
documentation error in #2442 - @Carbon32 added a Spanish translation of the README file in #2430
- @novialriptide corrected casing for macOS in #2538
- @Notenlish fixed caution visual bug for dark theme in #2418
- @JiffyRob added docs for
devicename
parameter inmixer.init
in #2525 - @JorasOliveira clarified
event.custom_type
docs in #2527 - @ZeroWave022 added typing support for
sprite.collide_mask
ascollided
argument insprite.spritecollide
in #2569 - @Starbuck5 removed some obsolete information in #2459 and #2499
- @Matiiss added positional-only parameter notation (
/
in function signature) in #2457. This removes ambiguity from the docs about whether a function supports keyword arguments or not. - @Matiiss edited
scrap
docs to highlight non-deprecated functions in #2515 - @MyreMylar added some missing
versionadded
tags inmouse
in #2573 - @MyreMylar added a Premultiplied Alpha tutorial in #2531
- @MyreMylar de-emphasise passing a list of rectangles to update in #2532
- @MyreMylar removed 'responsive' tables from docs CSS in #2509
- @MyreMylar added docs for windows DPI awareness hint and docs/tests for
SDL_MOUSE_TOUCH_EVENTS
in #2511, #2484. - @MyreMylar removed an unused param from
Surface.convert_alpha
docs in #2486
Other general updates
2.4.0.dev4
Hello!
A final dev pre-release before the release of 2.4.0 - please test it!
🍾 🐍 🎉 🌈
The 2.4.x series drops support for Python 3.7, which has reached EOL. If you are using this python version, consider upgrading!
(Yes these notes are mostly autogenerated, if something is missing from here, please do reach out and let us know! The notes for the final release is going to be more handwritten and polished)
Notable new features
- 🟢 A new, experimental, Circle geometry class - like
Rect
&FRect
, but for Circles. - 🚀 More SIMD based performance enhancements - for the transform submodule and filling surfaces with special blend modes.
- 🪟 More improvements to the experimental Window class - should be a lot easier to use for standard pygame software rendering using (e.g. using
.blit()
). - 🐛 And, as usual, lots of more enhancements and bug fixes. You can see the full list of changes below
And special thanks to all our new (and returning after a while) contributors.
What's Changed
- We no longer have any OBJ-c source, remove tag mention by @Starbuck5 in #2499
- Fix SDL_ConvertSurface(Format) for SDL3 by @Starbuck5 in #2500
- Optimized
Rect/FRect
pgRect_FromObject
by @itzpr3d4t0r in #2041 - Fix incorrectly drawn edges with fillpoly by @Temmie3754 in #2131
- Port last SDL_CreateRGBSurface calls to SDL3-safe PG_CreateSurface by @Starbuck5 in #2501
- Fix grub-efi-amd64-signed installation failures on Ubuntu 20.04 CI builds by @MyreMylar in #2504
- Strip the leading SDL_ from the pixel format name by @MyreMylar in #2477
- Remove RDTSC key because detection removed in SDL3 by @Starbuck5 in #2502
- Implemented
(F)Rect.move_to
by @Matiiss in #2165 - Remove spurious comment by @Julian-O in #2507
- Remove deprecated blend attribute from draw_aaline() & draw_aalines() by @MyreMylar in #2506
geometry
module,Circle
base by @itzpr3d4t0r in #2268- Fix caution visual bug for dark theme by @Notenlish in #2418
- run clang-format on the vendored contents of SDL_gfx/ by @MyreMylar in #2508
- Add docs for windows DPI awareness hint by @MyreMylar in #2511
- Optimized
pgRect_FromObject
by @Matiiss in #2465 - Moving current scrap API docs to the top to avoid confusion by @Matiiss in #2515
display.message_box()
by @yunline in #2427- Window grab API rework by @yunline in #2379
- Fix problems caused by #2379 by @yunline in #2520
- Update pygame.examples.go_over_there for Python 3.12 by @llindstrom in #2521
- Fix issue #2109: Added requested tests by @JorasOliveira in #2492
- Make mpg123, fluidsynth and sndfile not link directly to lower-level audio playback libs by @ankith26 in #2471
- Add docs for "devicename" parameter in 'pygame.mixer.init()' by @JiffyRob in #2525
- Remove the unused Surface param from convert alpha docs by @MyreMylar in #2486
- changed to wording in order to make it more clear by @JorasOliveira in #2527
- Fix issue #2446: rotozoom keeps the colorkey flag. by @igordsm in #2491
- Fix segmentation fault when destroying window by @novialriptide in #2530
- Correct casing for macOS by @novialriptide in #2538
- Update
pygame.version
to not be an autogen file by @ankith26 in #2537 - Add Circle
collidepoint()
by @itzpr3d4t0r in #2536 - Added missing Circle attrs by @itzpr3d4t0r in #2519
- Add SSE2 intrinsics smoothscale backend by @Starbuck5 in #2473
- Fix Circle stubs by @itzpr3d4t0r in #2545
- Remove 'responsive' tables from docs CSS by @MyreMylar in #2509
- Don't double install mac deps, cleanups by @ankith26 in #2513
- Add Circle
collidecircle()
by @itzpr3d4t0r in #2540 - Fix segfault when passing empty StringIO/File object to Font by @MyreMylar in #2548
- Add the default font to sysfonts by @MyreMylar in #2543
- Remove and deprecate cythonised sprite module by @MyreMylar in #2546
- De-emphasise passing a list of rectangles to update by @MyreMylar in #2532
- Fix RLE usage in the transform module by @MyreMylar in #2535
- Remove blend from draw.aaline by @MightyJosip in #2550
- Fix segfault in Texture.update() by @yunline in #2553
- Compile SSE2 smoothscale intrinsics on NEON by @Starbuck5 in #2544
- Fix setDaemon() deprecation error by @MyreMylar in #2559
- AVX Surface.fill() setup, AVX BLEND_ADD by @itzpr3d4t0r in #2382
- Add Premultiplied Alpha tutorial by @MyreMylar in #2531
- Add SIMD versions of the greyscale transform (attempt #2) by @MyreMylar in #2432
- Rect.clipline() optimization by @itzpr3d4t0r in #2563
- Add
Window.mouse_rect
by @yunline in #2564 - Fix compiler warnings in event, camera and display by @ankith26 in #2567
- Rect.contains() optimization by @itzpr3d4t0r in #2570
- Support collide_mask as collided argument in spritecollide by @ZeroWave022 in #2569
- Add
get_surface()
for Window class by @yunline in #2350 mouse.get/set_relative_mode()
instead of_sdl2.Window.relative_mouse
by @yunline in #2076- Reduce amount of usage of "dummy" in codebase to minimum by @MyreMylar in #2547
- Updated
video.py
example so it usespygame.display.message_box
by @bilhox in #2572 - Fix for windows cameras without framerate by @Starbuck5 in #2574
- Window update->flip, doc changes by @Starbuck5 in #2577
- Add versionadded tag set_relative_mode by @MyreMylar in #2573
- Adding positional-only parameter notation (
/
in function signature) by @Matiiss in #2457 - Raise minimum SDL version to 2.0.10 by @Starbuck5 in #2584
- C loader targets a python alias by @pmp-p in #2586
- Fix gfxdraw.bezier for a lot of points by @Temmie3754 in #2503
- Smoothscale: deprecate old backends, update docs by @Starbuck5 in #2583
- Install meson+ninja on buildscripts, bump glib by @ankith26 in #2549
- Update SDL 2.26.5 -> 2.28.5 by @Starbuck5 in #2580
- Add lerp & smoothstep to math module by @robertpfeiffer in #2254
- Improved
blit()
docs by @itzpr3d4t0r in #2262 - Make Texture and Renderer compatible with float input (floor() based pixel rasterisation/conversion changing to round()) by @yunline in #2039
- Compile windows _camera on MSVC only by @ankith26 in #2585
- Added missing AVX2 fillers by @itzpr3d4t0r in #2565
- Add multiplayer joystick example by @KentAugust in #2524
- Subclassing Sounds + Channels. by @gresm in https://github.com/pygame-commu...