Releases: pygame-community/pygame-ce
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, @andrewhong04, @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 - @andrewhong04 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
- @andrewhong04 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
- @Matiiss improved
Surface.fill
error message for invalid blend flags in #2434 - @ankith26 dropped Python 3.7 support in #2493
- @MyreMylar reduced usage of "dummy" in codebase to minimum in #2547
- @MyreMylar s...
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 @andrewhong04 in #2530
- Correct casing for macOS by @andrewhong04 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-communi...
2.4.0.dev2
A pre-release for testing before the full release, thanks to everyone! 🥳
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)
What's Changed
- Start 2.4.0 by @ankith26 in #2362
- Minor improvements to
Window.size
andWindow.position
C code by @Matiiss in #2367 - correct typo in rect test methods by @dr0id in #2359
- remove SDL_VERSION_ATLEAST(2, 0, 5) by @yunline in #2372
- Remove sdlmain_osx.m by @Starbuck5 in #2357
- Try getting freetype tests running on CI, fix minor test fail issues by @ankith26 in #2370
- Improved
blits()
docs by @itzpr3d4t0r in #2263 - Bump pypa/cibuildwheel from 2.14.1 to 2.15.0 by @dependabot in #2396
- Bump uraimo/run-on-arch-action from 2.5.0 to 2.5.1 by @dependabot in #2397
- Cap the sphinx version under 7.2.0 by @oddbookworm in #2407
- Add a
mixer.Channel.id
getter by @oddbookworm in #2369 - Remove mentions of overlay module by @zoldalma999 in #2411
- added keyword use_values to collidedict and collidedictall by @oddbookworm in #2309
- Added
Window.(min|max)imum_size
by @Matiiss in #2364 - Support int and str input for color values in video module by @yunline in #2400
- Update README.fr.rst (fix typos,
pygame
=>pygame-ce
...) by @bilhox in #2228 - minor sprite doc fixes by @oddbookworm in #2423
- Bump actions/checkout from 3.5.3 to 3.6.0 by @dependabot in #2424
- Add unitest for
Window
by @yunline in #2230 - Add SIMD functionality to the transform submodule (Attempt 2) by @MyreMylar in #2421
- Patches so constants.c compiles in SDL3 by @Starbuck5 in #2437
- Use format instead of masks (4) by @Starbuck5 in #2439
- Use format instead of masks (5) by @Starbuck5 in #2440
- Improved
Surface.fill
error message for invalid blend flags by @Matiiss in #2434 - Use RAISE when appropriate by @Starbuck5 in #2444
- Bump actions/checkout from 3.6.0 to 4.0.0 by @dependabot in #2449
- Corrects sprite documentation error by @sweatshirtwearingviper in #2442
- Bump actions/cache from 3.3.1 to 3.3.2 by @dependabot in #2448
- Bump docker/build-push-action from 4.1.1 to 4.2.1 by @dependabot in #2447
- Optimize vector parsing in math.c by @Starbuck5 in #2443
- get_just_pressed and get_just_released by @ScriptLineStudios in #1912
- Add
get_power_state()
by @yunline in #2257 - Bump docker/metadata-action from 4.6.0 to 5.0.0 by @dependabot in #2454
- Bump docker/build-push-action from 4.2.1 to 5.0.0 by @dependabot in #2455
- Bump docker/login-action from 2.2.0 to 3.0.0 by @dependabot in #2456
- Fix linter failing due to new clang-format version by @Matiiss in #2461
- Spanish Translation by @Carbon32 in #2430
- Remove conan buildconfig by @Starbuck5 in #2460
- Remove experimental notice on system module by @Starbuck5 in #2459
- Made many
Rect/FRect
methods fastcall by @itzpr3d4t0r in #2043 - Bump actions/checkout from 4.0.0 to 4.1.0 by @dependabot in #2469
- Fix uint64 underflow in
tick_busy_loop
by @oddbookworm in #2466 - Bump pypa/cibuildwheel from 2.15.0 to 2.16.0 by @dependabot in #2468
- Raise minimum deps of SDL and friends by @Starbuck5 in #2464
- Bump versions of many manylinux deps by @ankith26 in #2470
- Skipping mixer test because it randomly fails on Linux by @Matiiss in #2438
- Up cibuildwheel by @Starbuck5 in #2474
- Remove test tests by @zoldalma999 in #2475
- WASM: add required PyObject *_null parameter to functions marked with METH_NOARGS in display.c by @Damus666 in #2480
- Remove old CI files by @zoldalma999 in #2479
- WASM: add required PyObject *_null parameter to remaining functions marked with METH_NOARGS in math.c and color.c by @Damus666 in #2482
- Add PG_CreateSurface(From) for SDL2/3 compat by @Starbuck5 in #2481
- Bump pypa/cibuildwheel from 2.16.0 to 2.16.1 by @dependabot in #2489
- Bump TheMrMilchmann/setup-msvc-dev from 2 to 3 by @dependabot in #2488
- Remove redundant check in pg_ResizeEventWatch by @Starbuck5 in #2487
- Drop python 3.7 by @ankith26 in #2493
- Deprecate set_mode depth argument by @zoldalma999 in #2490
- Enhancement/font/check initialization by @dr0id in #2371
- Port SDL_ShowCursor to SDL3 by @Starbuck5 in #2483
- Use SDL_MOUSE_TOUCH_EVENTS in touch test and docs by @MyreMylar in #2484
New Contributors
- @sweatshirtwearingviper made their first contribution in #2442
- @Carbon32 made their first contribution in #2430
- @Damus666 made their first contribution in #2480
Full Changelog: 2.3.1.dev4...2.4.0.dev2
2.3.2
☀️🌊🏖️😎🏄🐚🏝️🍹☀️🌊🏖️
pip uninstall pygame
(if previously installed, to avoid package conflicts)
pip install pygame-ce --upgrade
☀️🌊🏖️😎🏄🐚🏝️🍹☀️🌊🏖️
Hello and welcome to a shiny new bugfix release of pygame-ce
! While we are working towards a 2.4.0 release, we thought it'd be nice to have a quick 2.3.2 with a couple of fixes and enhancements.
Bug fixes
- New contributor @cyuria fixed a long standing and infamous bug in
pygame.draw.arc
in #2344 where arcs with widths would be incorrectly rendered with holes in between. music.get_pos
could segfault due to an internal zero division error, this has now been fixed by @oddbookworm in #2426- @ankith26 fixed a couple of overflow related bugs in mapped int color handling and improved the internal C API for it in #2349
- @oddbookworm fixed a case of segfaulting in
PixelArray
in #2276 - @Matiiss fixed
Sound.__init__
incorrectly raisingTypeError
instead ofFileNotFoundError
for some inputs in #2381 - @dr0id fixed
copy.deepcopy
support forSurface
in #2394 - @pmp-p fixed webassembly support of
pygame.newbuffer
andpygame.pixelarray
in #2419 and #2413
Codebase fixes and robustness improvements
- @pmp-p fixed compilation error when
lseek64
is absent (like webassembly 32 bit mode) in #2410 - @yunline replaced usage of
PYGAMEAPI_DISPLAY_INTERNAL
with the intendedBUILD_STATIC
inwindow.c
in #2412 - @dr0id added a lint warning ignore in
locals.py
to make the linter pass in #2393 - @yunline bumped cython to 3.0.0 in #2395
- @ankith26 bumped cibuildwheel in #2402 and as a result, this release now has wheels shipping for the python 3.12 release candidate, ready for the full release of Python 3.12 at the start of October!
Deprecation warnings
- @bilhox fixed joystick doc and properly deprecated
pygame.Joystick.init/get_id
in #2363 - @ankith26 deprecated passing out of range sequence lengths to colorspace setters in #2392
Unit-tests, typing and examples related improvements
- @dr0id fixed
ftfont
to pass same tests asfont
in #2180 - @Matiiss removed an unneeded
mixer
test skip in #2384 - @devdanzin fixed the rect typing with
Union[FRect, Rect]
insprite
in #2380 - @dr0id fixed
property
usage issues infont
stubs in #2358 - @ddorn fixed stubs for
Color.__getitem__
in #2391 - @yunline fixed a couple of typing issues in
Window
and also did some cleanups in #2366 - @ankith26 fixed minor issues in joystick and moveit examples in #2387
- @robertpfeiffer improved glcube example and display docs in #2038
New Contributors
Thanks all
Sincere thanks to everyone helping out! In addition to PR makers, as always we are thankful to the community at large and this includes issue reporters, PR reviewers, tutorial makers, admins/mods/helpers on various online forums, people who make helper libraries, and last but certainly not least, all our users including you: the person reading these notes!
If we've made a mistake in these notes, please get in touch with us to get a correction made.
Cya, have fun using pygame-ce
!
Full Changelog: 2.3.1...2.3.2
2.3.1
☀️🌊🏖️😎🏄🐚🏝️🍹☀️🌊🏖️
pip uninstall pygame
(if previously installed, to avoid package conflicts)
pip install pygame-ce --upgrade
☀️🌊🏖️😎🏄🐚🏝️🍹☀️🌊🏖️
Heya, welcome to another release of pygame-ce
!! It's been about 2 months since the last release and there have been a lot of nice additions, enhancements and bugfixes. We hope this release treats you well until we get the next release out ;)
This release has several changes to the wheels (binaries) we distribute. We've raised our minimum MacOS version from 10.9 to 10.11, following our dependencies. Unlike previous releases, this release has wheels for aarch64
Linux, Python 3.12 beta releases, and Pypy 3.10. We've dropped wheels for Pypy3.7 due to lack of use. Thanks to @ankith26 and @Starbuck5 for these updates, in #2171, #2352, #2325, #2315, and #2335.
See what we've been working on!
New additions
- @andrewhong04 added the
point_size
attribute tofont.Font
in #1961. This allows fonts to be resized after being loaded. - @dr0id added
style_name
property tofont.Font
/freetype.Font
in #2175 - @yunline added two
pygame.system
functionsget_cpu_instruction_sets
andget_total_ram
in #2308. These can be used to find out more about the system at runtime. - @dr0id added new
Rect
/FRect
methods -scale_by
/scale_by_ip
and @jonotassia updated these to accept keyword-arguments. This addition was ported topygame-ce
by @Starbuck5 in #2277 - New contributor @AlexanderGroeger added functions to manage soundfonts (
get_soundfont
andset_soundfont
) tomixer
in #2274. This is relevant for midi playback throughpygame.mixer
. - @Matiiss added a few convenience classmethods -
Color.from_<color_space>
(i.e.Color.from_hsla
) in #2177 - @yunline added
always_on_top
attribute to_sdl2.video.Window
in #2307. Now you can use this to force yourWindow
s to always be highlighted at the top.
Potential breaking changes
- @yunline fixed
transform.gaussian_blur
to handle radius like other standard implementations in #2246 (as an effect of this change, the output will be visually different to the older versions) - @that1guy232 removed the obsolete and deprecated vidcapture camera backend in #2207
Bug fixes
time.set_timer
had a long standing bug in which one could get a segfault in some cases (like the timer duration being too low). @ankith26 fixed this in #2284 along with other enhancements to code quality and performance. As a resultset_timer
is now much more accurate with the timing!- @ankith26 fixed
FRect
slice subscripting to correctly returnfloat
s in #2313 - @yunline added support for
SDL_WINDOWID
back, fixing a long standing compatibility issue with pygame 1 in #1953. However, this fix is not perfect, and there are some known issues with it (like certain events not working). We heavily recommend not using this. pygame-ce
2.3.0 introduced a regression whereSysFont
could no longer handleNone
. @Sjmarf fixed this in #2271- Another
pygame-ce
2.3.0 regression was in_sdl2.video.Window
, this class was no longer usable when pyinstaller was used. @Starbuck5 fixed this by correctly marking a hiddenimport in the pyinstaller hook in #2287 - @yunline fixed potential segfaults in
font
in #2255 - @zoldalma999 fixed a segfault related to
_sdl2.Window.from_display_module
that happened ondealloc
in #2341
Usage and performance enhancements
- @ScriptLineStudios added support for
Vector2
objects inget_at
/set_at
methods ofSurface
in #2111 - @itzpr3d4t0r improved the performance of
Surface.set_at
by changing it to useFASTCALL
in #2330 - @yunline added
__repr__
to the_sdl2.video.Window
class in #2345
Docs and examples improvements
- New contributor @devdanzin fixed the positioning of the theme icon of the docs when the page shrinks in #2321
- New contributors @Martinus2004 and @JiffyRob updated existing example programs to use
pygame-ce
multiline text rendering. #2219, #2235 - New contributor @IrvKalb corrected the documentation of the
get_pref_path
function in thesystem
module to use theorg
argument in the example in #2326 - @Mega-JC made "note" blocks in the documentation look more distinct. #2163
- @VantaTree fixed a typo in the event docs in #2290
- @oddbookworm removed
pygame.cdrom
references from documentation and code in #2327 - @bilhox updated joystick docs to reflect changed mappings of the joycon controllers in #2258
- @rethanon added named colors to docs of the
draw
andSurface
modules in #2346 - @Starbuck5 removed
SDL
version information where it mentions versions that are below our supportedSDL
version in #2334
Unittests and typing related improvements
- @oddbookworm improved
Rect
/FRect
typing to be more generic and accurate in #2297 - @ankith26 made some types more lax by using a custom
Sequence
ABC and also fixed some other related issues in #2292 - @ankith26 made freetype tests run again on CI and fixed minor test failures in #2383 and #2370
Code robustness and cleanups
- @zoldalma999 renamed
PyClockObject
topgClockObject
, remove rendered field, small cleanups intime.c
in #2351 - @yunline fixed warnings in
video.c
in #2343 and removed the oldWindow
cython sources in #2294 - @Starbuck5 did a lot of code cleanups and maintenance work. #2272, #2318, #2278, #2305, #2301, #2328, #2316, #2347, #2356
New Contributors
- @Martinus2004 made their first contribution in #2219
- @devdanzin made their first contribution in #2321
- @JiffyRob made their first contribution in #2235
- @IrvKalb made their first contribution in #2326
- @AlexanderGroeger made their first contribution in #2274
Thanks all
Sincere thanks to everyone helping out! In addition to PR makers, as always we are thankful to the community at large and this includes issue reporters, PR reviewers, tutorial makers, admins/mods/helpers on various online forums, people who make helper libraries, and last but certainly not least, all our users including you: the person reading these notes!
If we've made a mistake in these notes, please get in touch with us to get a correction made.
Cya, have fun using pygame-ce
!
Full Changelog: 2.3.0...2.3.1
2.3.1.dev4
The last pre-release before the full release, for testing. Thanks to everyone! 🎉
(Yes this stuff is 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)
What's Changed
- 2.3.1.dev2 by @ankith26 in #2332
- Start 2.3.1.dev3 by @ankith26 in #2333
- Continue moving away from format masks again by @Starbuck5 in #2328
- Remove irrelevant SDL version information by @Starbuck5 in #2334
- removed pygame.cdrom refs everywhere by @oddbookworm in #2327
- Update joystick.rst - Switch Joy-cons mappings wrong by @bilhox in #2258
- vector2 support for Surface.get_at and set_at by @ScriptLineStudios in #2111
- Drop pypy3.7, add wheels for pypy3.10 by @Starbuck5 in #2335
- Fix typos + update sse2neon by @Starbuck5 in #2347
- Add pg_post_event and DictProxy C API to release GIL, fix timer issues and speedups by @ankith26 in #2284
- Reset window data on borrowed windows on dealloc by @zoldalma999 in #2341
- Add
__repr__
for Window class by @yunline in #2345 - Rename PyClockObject to pgClockObject, remove rendered field, small cleanups by @zoldalma999 in #2351
- Fix warnings in video.c by @yunline in #2343
- Port SDL_cpuinfo.h by @yunline in #2308
- Add Named Colors to docs for pygame.draw and pygame.Surface by @rethanon in #2346
- Re-add CircleCI for aarch64 builds by @ankith26 in #2352
- Corrected MacOS get_pref_path() documentation by @IrvKalb in #2326
- Made
Surface.set_at()
fastcall by @itzpr3d4t0r in #2330 - add style_name property to font and freetype font by @dr0id in #2175
- Use OIDC to publish PyPI releases by @ankith26 in #2355
- Support
SDL_WINDOWID
by @yunline in #1953 - Enabling users to set the soundfont on midi playback by @AlexanderGroeger in #2274
- Don't use SDL_ name for our compat layer by @Starbuck5 in #2356
- Add
.point_size
attribute modifier for fonts by @andrewhong04 in #1961
New Contributors
- @IrvKalb made their first contribution in #2326
- @AlexanderGroeger made their first contribution in #2274
Full Changelog: 2.3.1.dev2...2.3.1.dev4
2.3.1.dev2
A pre-release for testing before the full release, thanks to everyone! 🥳
(Yes this stuff is 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)
What's Changed
- 2.3.0 by @Starbuck5 in #2250
- Start 2.3.1 by @Starbuck5 in #2251
- Bump docker/metadata-action from 4.4.0 to 4.5.0 by @dependabot in #2242
- Bump docker/login-action from 2.1.0 to 2.2.0 by @dependabot in #2241
- Bump docker/build-push-action from 4.0.0 to 4.1.0 by @dependabot in #2240
- Added multiline text rendering to eventlist example by @Martinus2004 in #2219
- Remove obsolete vidcapture camera backend (#1660) by @that1guy232 in #2207
- Fix segfault when rendering fonts by @yunline in #2255
- Bump docker/metadata-action from 4.5.0 to 4.6.0 by @dependabot in #2260
- Bump docker/build-push-action from 4.1.0 to 4.1.1 by @dependabot in #2261
- Fix SysFont None issue by @Sjmarf in #2271
- Gaussian blur radius fix by @yunline in #2246
- Restore SDL 2.0.9 support by @Starbuck5 in #2272
- Adjust pypi tags by @Starbuck5 in #2279
- Remove unused code from test utils by @Starbuck5 in #2278
- Raise macOS deployment target to 10.11 by @Starbuck5 in #2171
- Port Rect.scale_by(|_ip) by @Starbuck5 in #2277
- Add window hiddenimport by @Starbuck5 in #2287
- Reveal
.. note::
reST block background color again by @Mega-JC in #2163 - Fixed typo in event.rst by @VantaTree in #2290
- Added
Color.from_<color_space>
classmethods by @Matiiss in #2177 - Remove the old Window cython sources by @yunline in #2294
- Regenerate Cython using 0.29.36 by @Starbuck5 in #2305
- Update pixelformat to modern format, fix typos by @Starbuck5 in #2301
- Improved Rect and FRect typing to be more generic and accurate by @oddbookworm in #2297
- 2.26.5 by @Starbuck5 in #2317
- Fix FRect slice subscripting by @ankith26 in #2313
- Introduce new custom 'Sequence' ABC, fix issues by @ankith26 in #2292
- Bump pypa/cibuildwheel from 2.13.1 to 2.14.1 by @dependabot in #2324
- Remove unnecessary macro by @Starbuck5 in #2316
- Move to SDL 2.26.5 by @Starbuck5 in #2318
- Fix theme icon positioning when the page shrinks (fix #2320) by @devdanzin in #2321
- Multiline examples by @JiffyRob in #2235
- Replace Py_FileSystemDefaultEncoding by @Starbuck5 in #2315
- Add
always_on_top
attribute for video.Window by @yunline in #2307 - 3.12 wheels by @Starbuck5 in #2325
New Contributors
- @Martinus2004 made their first contribution in #2219
- @devdanzin made their first contribution in #2321
- @JiffyRob made their first contribution in #2235
Full Changelog: 2.3.0...2.3.1.dev2
2.3.0
pygame-ce 2.3.0
☀️🌊🏖️😎🏄🐚🏝️🍹☀️🌊🏖️
pip uninstall pygame
pip install pygame-ce --upgrade
☀️🌊🏖️😎🏄🐚🏝️🍹☀️🌊🏖️
Welcome to the newest release of pygame-ce! Summer is near (here in the northern hemisphere), and with that comes the time of vacations and game jams. The pygame-ce team has been working hard on improving several things for the last few months so you can enjoy your programming activity. You will be seeing a lot of light during these months, so for a change you can now view the pygame-ce documentation in dark mode. Outside of that, there have been a lot of other improvements, bug fixes, and other stuff which are listed below. We hope you will enjoy the changes, and we will continue to improve our beloved library in the following releases.
Besides the dark mode docs, a big story in this release are improvements to the experimental pygame._sdl2 module. It now has non-skeleton documentation, and the Window class was completely rewritten in C to enable better integration with the rest of pygame-ce.
Check out what we've been working on!
What's Changed
Additions
- @durkisneer1 added the
pygame.Surface.get_frect()
convenience method. #2071 - @yunline added
pygame.mixer.Channel.set_source_location()
(for panning-like effects). #1844 - @PurityLake added keyword argument support to
Font.render()
. #2000 - @Sjmarf improved a font warning message emitted when requested system fonts are not found. For example:
The system font 'comicsans2' couldn't be found. Did you mean: 'comicsans', 'comicsansms'?
#2147
Bug Fixes
- @ankith26 fixed audio issues on older Macs (like pygame.mixer wouldn't work at all). If you see
Library not loaded: @loader_path/libmp3lame.0.dylib
, this is fixed now. #2118 - @Starbuck5 fixed a regression where "tracker music" (XM/MOD/IT files) would no longer play on Windows. #2152
- @Starbuck5 fixed a regression in
pygame.transform.scale()
when scaling to a destination surface with a different pixel format. #2172 - @yunline fixed a
SystemError
issue when disconnecting and reconnecting controllers. #2048 - @Temmie3754 fixed issue when converting surface to 8 bit surface with palettes. #2031
- @yunline made it so pygame-ce will raise an error if source and destination surfaces are the same in
pygame.transform.(box/gaussian)_blur
, rather than just producing incorrect results. #2161 - @cbdj fixed the Android build configuration. #2249
Optimizations
- @ScriptLineStudios optimized a case for
pygame.draw.polygon
when drawing triangles. #2126 - @itzpr3d4t0r optimized
pygame.Rect.move
,pygame.Rect.move_ip
(and corresponding FRect methods) with FASTCALL, a 20-40% speedup. #2040 - @Matiiss optimized
pygame.Surface.get_(f)rect
with FASTCALL, achieving a 20-40% speedup as well. #2179 - @Starbuck5 slightly improved create/destroy performance and reduced memory usage of
pygame.math.Vector(2/3)
(enabling future optimizations). #2174
Deprecations
- @MyreMylar added deprecation warnings for
pygame.sprite.RenderPlain
,pygame.sprite.RenderClear
andpygame.sprite.OrderedUpdates
(will be removed in pygame-ce 2.4.0). #2036 - @SSS-Says-Snek added deprecation warnings for
pygame.image.tostring
andpygame.image.fromstring
in favor of(to/from)bytes
. #2101
Documentation, Examples, and Type Hints
- @Notenlish added an optional dark mode to the pygame-ce documentation! What an impressive first contribution! This can be enabled/disabled by the sun/moon icon next to the search bar in the upper right. @MyreMylar and @rethanon also contributed to fix a few styling gremlins that emerged.. #2122, #2226, #2215, #2248
- @oddbookworm, @Temmie3754, @narilee2006, @Starbuck5 all worked on "pygame-ce-ification"-- making sure the documentation and code reflect "pygame-ce" rather than "pygame" in relevant places. #2203, #2133, #2112, #2194
- @Mega-JC vastly expanded the experimental pygame._sdl2 documentation. #2128
- @Starbuck5, @narilee2006, and @yunline contributed miscellaneous documentation improvements. #2183, #2096, #2099, #2106
- @that1guy232 improved several of the pygame-ce example programs, making them more modern and consistent. #2204, #2191, #2193
- @oddbookworm added type hints for
pygame.PixelArray
. #2113 - @bilhox and @jd-develop worked to translate the README into French, @yolowex translated the README into Persian. #2140, #2187, #2201
Operations and Code Quality
- @yunline rewrote the _sdl2.video.Window class into C from Cython, which is huge for our processes moving forward. #2114
- @yunline changed the default _sdl2.video.Window window title to match pygame.display. #2200
- @MyreMylar, @ankith26, and @Starbuck5 kept pygame-ce operations moving forward. #2213, #2173, #2212, (+release PRs)
- @yunline and @Starbuck5 worked explicitly on code quality to stay resilient for future changes. #1939, #2196, #2210, #2108, #2123, #2195
New Contributors
- @narilee2006 made their first contribution in #2096
- @durkisneer1 made their first contribution in #2071
- @bilhox made their first contribution in #2140
- @that1guy232 made their first contribution in #2191
- @jd-develop made their first contribution in #2187
- @yolowex made their first contribution in #2201
- @Notenlish made their first contribution in #2122
- @cbdj made their first contribution in #2249
Other News
DaFluffyPotato gave us a shoutout in a video about pygame-ce on his channel, titled "Pygame CE - Better & Faster." Check it out if you're interested: https://www.youtube.com/watch?v=pYq9edSUaOw
Full Changelog: 2.2.1...2.3.0
2.3.0.dev4
What's Changed
- 2.3.0.dev2 by @Starbuck5 in #2168
- 2.3.0.dev3 by @Starbuck5 in #2169
- added stub info for PixelArray.getitem by @oddbookworm in #2113
- Manually bump actions/cache, minor usage updates by @ankith26 in #2173
- Raise an error when source and destination surfaces are the same (in
box_blur
andgaussian_blur
). by @yunline in #2161 _sdl2.video
docs rewrite, minor reorderings & method signature changes by @Mega-JC in #2128- Update cursors_module_example.py by @that1guy232 in #2191
- Minor documentation updates by @Starbuck5 in #2183
- Updated Chimp Example Explanation for #2033 by @that1guy232 in #2193
- A bit of pygame-ce-ification by @Starbuck5 in #2194
- Include more info in version by @Starbuck5 in #2195
- Use
Py_TYPE(self)->tp_free(self)
instead ofPyObject_Free
by @yunline in #2196 - Update README.fr.rst (fix French grammar/punctuation/spelling/etc. mistakes) by @jd-develop in #2187
- Updated scrap code example. by @that1guy232 in #2197
- Fix the default value of title argument in video.Window by @yunline in #2200
- Re-allow destsurf scale w/ diff but compatible pixelformats by @Starbuck5 in #2172
- Bump pypa/cibuildwheel from 2.12.3 to 2.13.0 by @dependabot in #2205
- Issue redirection (correct one) by @oddbookworm in #2203
- Optimize
Surface.get_(f)rect
by @Matiiss in #2179 - updated scrap related code. by @that1guy232 in #2204
- Remove
event._joy_instance_map
by @yunline in #2048 - Optimize vector coords memory by @Starbuck5 in #2174
- Added persian transaltion for README.rst by @mmdmoa in #2201
- Font warning spellcheck by @Sjmarf in #2147
- Add dark theme for documentation by @Notenlish in #2122
- Update sse2neon to latest version by @MyreMylar in #2213
- Fix the large inline code sections in the dark theme by @MyreMylar in #2215
- speedup for triangle rendering by @ScriptLineStudios in #2126
- Use builtin broadcasting intrinsics in blitters by @Starbuck5 in #2210
- fix search page green background in dark theme by @Notenlish in #2226
- Fix MAC_ARCH environment variable on CI by @MyreMylar in #2212
- Port video.Window to C by @yunline in #2114
- Add mixer.Channel.set_source_location() by @yunline in #1844
- Fix issue with converting surfaces to 8 bit surfaces with palettes by @Temmie3754 in #2031
New Contributors
- @that1guy232 made their first contribution in #2191
- @jd-develop made their first contribution in #2187
- @mmdmoa made their first contribution in #2201
- @Notenlish made their first contribution in #2122
Full Changelog: 2.3.0.dev2...2.3.0.dev4
2.3.0.dev2
What's Changed
- Release/2.2.1 by @Starbuck5 in #2093
- Re-start 2.3 by @Starbuck5 in #2094
- Redirect home_uri to pyga.me/docs by @narilee2006 in #2096
- New title for the unittests README. by @narilee2006 in #2099
- Fix typo by @yunline in #2106
- Create Surface.get_frect method by @durkisneer1 in #2071
- Undocument and deprecate redundant sprite group classes by @MyreMylar in #2036
- Add ce by @narilee2006 in #2112
- Start move away from format masks (prep for SDL3) by @Starbuck5 in #2108
- Bump actions/checkout from 3.5.0 to 3.5.2 by @dependabot in #2119
- Made
Rect/FRect
move/move_ip
FASTCALL by @itzpr3d4t0r in #2040 - Bump docker/metadata-action from 4.3.0 to 4.4.0 by @dependabot in #2129
- Bump pypa/cibuildwheel from 2.12.1 to 2.12.3 by @dependabot in #2130
- Continue moving away from format masks by @Starbuck5 in #2123
- Deprecate pygame.image.tostring and fromstring by @SSS-Says-Snek in #2101
- Fix mac wheels issue: sndfile disable lame mpeg by @ankith26 in #2118
- french README by @bilhox in #2140
- fix #2087 until SDL catches up by @robertpfeiffer in #2088
- Tracker music fixes by @Starbuck5 in #2151
- Bump robinraju/release-downloader from 1.7 to 1.8 by @dependabot in #2148
- Update docs to use pygame-ce versioning by @Temmie3754 in #2133
- Fixes for tracker music support, add test by @Starbuck5 in #2152
- Clean video.pyx (Move declarations to pxd file) by @yunline in #1939
- Added keyword arguments to
Font.render
by @PurityLake in #2000
New Contributors
- @narilee2006 made their first contribution in #2096
- @durkisneer1 made their first contribution in #2071
- @bilhox made their first contribution in #2140
Full Changelog: 2.2.1...2.3.0.dev2