Skip to content

Releases: pygame-community/pygame-ce

2.2.1

02 Apr 23:34
Compare
Choose a tag to compare

pygame-ce 2.2.1

# if you're switching over from pygame/pygame,
# remove it first to avoid conflicting namespace
pip uninstall pygame
pip install pygame-ce==2.2.1

This is a quick patch release to address a reported regression in a certain type of alpha blits, after the blit optimizations from 2.2.0. We're not sure how common this issue is, only one person reported it, but we wanted to get a release out quickly to address it.

We're also including all the changes since 2.2.0 merged in the last ~week, so it's not just that bugfix, we also have some nice enhancements.

What's Changed

Enhancements

  • @ankith26 and @Starbuck5 pulled in updates for pygame's dependencies: SDL and SDL satellite libraries. This updates us with all their hard work fixing bugs. #2057, #1986

  • @Starbuck5 sped up pygame.transform.scale and scale_by by replacing our internal scaling algorithm with an SDL function which is 10-40% faster. #1884

  • @SSS-Says-Snek added some helpful information to the Surface repr. When you print a surface, it looks like <Surface(50x50x32 SW)>. Now, it might look like <Surface(50x50x32, colorkey=(255, 255, 255, 255))> or <Surface(50x50x32, global_alpha=200)>. The idea is to give more information in the representation when there is more relevant things to know about the Surface. We hope that this will help people confused by Surface behavior in debugging. #2016

  • @Sjmarf made it so font.Sysfont will emit a warning if your font choice fell back to the default font. #1973

Bugfixes

  • @Starbuck5 fixed a regression in one of the AVX2 alpha blitters, thanks to @bigwhoopgames for the bug report. #2067

  • @dr0id fixed a bug where Sysfont could rarely give you a non-existent font file on Windows. (That's what we get for believing the Windows registry) #2034

  • @robertpfeiffer fixed a regresion where having $XDG_SESSION_TYPE not set would cause a crash in display.set_mode #2079

Docs, Examples, and Types

Cleanups and Robustness

New Contributors

Other News

Full Changelog: 2.2.0...2.2.1

2.2.0

25 Mar 09:32
Compare
Choose a tag to compare

pygame-ce 2.2.0

pygame_logo_transform

  • Demo of transform grayscale, invert, and blur routines. Invert and blur new in this release.
# if you're switching over from pygame/pygame,
# remove it first to avoid conflicting namespace
pip uninstall pygame
pip install pygame-ce==2.2.0

Welcome to the newest release of pygame-ce! We're excited to share the last month's worth of merged
enhancements, bugfixes, and cleanups.

What's Changed

Enhancements

  • @Emc2356 and @yunline added pygame.FRect, a version of pygame.Rect that supports floating point values! The FRect class supports the whole pygame.Rect API. This is useful so that one can use floating point values for position, while still being a Rect. #1944, #2046

  • @Starbuck5 accelerated many types of alpha blitting using AVX2 instructions, achieving a 30-300% performance gain when blitting with transparent Surfaces (on supported systems). #2019

  • @robertpfeiffer made it possible to use VSYNC in a normal (non-SCALED) pygame display setup, also added is_vsync, get_current_refresh_rate, get_desktop_refresh_rates functions. #1874

  • @ScriptLineStudios added pygame.transform.invert, which inverts the RGB color of each pixel in a Surface. #1911

  • @yunline added pygame.transform.box_blur and pygame.transform.gaussian_blur. #1836, #2026, #2028

  • @Starbuck5 and @ankith26 added a new module! pygame.system is for miscellaneous system information. Right now it has get_pref_path to create a persistent data directory and get_pref_locales to get system locale information. #1897

  • @MyreMylar accelerated the BLEND_PREMULTIPLIED blend mode using AVX2 instructions (2-6x faster). #5, #2005

  • @oddbookworm added a new copy-paste API in the scrap module, which is easier to use and more portable. #1984

  • @novialriptide added a Font.name attribute, to get the proper name of the font. #1971

  • @avaxar implemented swizzling for pygame.Color-- I.e. color.rgb, color.bgr, color.garb. #1935, #1994

  • @avaxar updated several object representations to better conform to Python standards. For example, pygame.Rect(1,2,3,4) is now represented as Rect(1, 2, 3, 4) instead of <rect(1, 2, 3, 4)>. #1995

  • @yunline added full support for keyword arguments in the image module. #2010

Bugfixes

Deprecations, Potential Breaking Changes, and Removals

  • Legacy pygame.scrap functions are now deprecated. Contributed by @oddbookworm. #1984

  • pygame.fastevent has been removed. Contributed by @gresm. #1966

  • pygame.mixer now raises a FileNotFoundError when the sound isn't found on the filesystem. Contributed by @Temmie3754. #2001

Docs, Examples, and Types

Cleanups and Robustness

Operations

New Contributors

Governance

Since last release, we're proud to welcome three new members of the project!
Congratulations to @yunline, @itzpr3d4t0r, and @dr0id.

We've also elected (among the contributors) a group of three contributors to the "steering council" -- responsible for releases and for resolving debates. The current steering council is @MyreMylar, @ankith26, and @Starbuck5. See https://github.com/pygame-community/pygame-ce/wiki/The-Steering-Council.

Full Changelog: 2.1.4...2.2.0

2.2.0.dev2 - dev release for testing

23 Mar 00:12
Compare
Choose a tag to compare
Pre-release

What's Changed

New Contributors

Full Changelog: 2.1.4...2.2.0.dev2

2.1.4

05 Mar 06:58
Compare
Choose a tag to compare

pygame-ce 2.1.4

# if you're switching over from pygame/pygame,
# remove it first to avoid conflicting namespace
pip uninstall pygame
pip install pygame-ce==2.1.4

Welcome, all! This release contains all the changes in the main branch of pygame/pygame from October through early February, mainly written by pygame-ce contributors, and of course all the pygame-ce progress in the past month!

Thank you to the community for all the support since the last release!

Because this contains so many months of changes, the release notes are quite long, so prepare yourself before reading further :).

What's Changed

Enhancements

  • @Starbuck5 and @oddbookworm worked on features to make font rendering better than ever before!

    • Multiline text! You can set a pixel limit and do automatic line wrapping, and you can align text left/right/center. Additionally, Font.render will respect explicit newlines in the text. #1898
    • Internationalization! We can now render non-latin alphabets much better with new Font.set_script(...) and Font.set_direction(...) methods. For example, to render Arabic, you'd load a font that supports Arabic, Font.set_script("Arab"), and Font.set_direction(pygame.DIRECTION_RTL). #1956, upstream #3330
  • @Matiiss added pygame.mixer.music.get_metadata() to potentially grab title/album/artist/copyright metadata from music files. #8

  • @ScriptLineStudios added transform.grayscale and Color.grayscale (in case you're feeling gray). #1907

  • @itzpr3d4t0r dug into the source to optimize overhead on mouse.get_pos(), mouse.get_rel(), Rect.colliderect(), Rect.collidepoint(), Rect.collidelist(), Rect.collidelistall(). These functions don't usually bottleneck people's code, but regardless, a 30-40% speedup on them is a cool thing to have. upstream #3424, upstream #3322, #1832, #1905

  • @PurityLake optimized blit mode code, achieving a 15-20% speedup while using blit blend modes for computers without AVX2 support. upstream #3370

  • @MightyJosip optimized pygame.draw.circle's with width (I saw a 300% performance boost in one case). upstream #3550

  • @itzpr3d4t0r added Surface.fblits(), which achieves faster speeds than blits by being slightly less flexible about input, as well as being highly optimized code itself. #1831, #1965

  • @Matiiss added __round__() method for pygame.Vector(2/3). upstream #3559

  • @avaxar implemented pitch argument for pygame.image.frombuffer, pygame.image.from(string|bytes). #1863

  • @Matiiss replaced an unclear hardcoded error message with the value of SDL_GetError(). upstream #3641

  • @yunline add IS_CE constant to test for running on pygame-ce, i.e. if getattr(pygame, "IS_CE", False): print("Running pygame CE"). #1900

  • @yunline added a "window" attribute DROPFILE and DROPTEXT events. upstream #3568

  • @oddbookworm made every dependency version getter work the same way, and return linked version vs compiled version. upstream #3379 and upstream #3567

  • @PurityLake added aliases to common objects. E.g. pygame.Joystick(...) instead of pygame.joystick.Joystick(...), pygame.Font(...), pygame.Clock(...), pygame.Event(...), pygame.Channel(...). #1854

  • @oddbookworm added a debug method to print out tons of pygame details. #2

  • @avaxar implement draw_triangle and draw_quad in pygame._sdl2. #1876

  • @MyreMylar added a way to premultiply a Surface's alpha, starting on a track towards optimized alpha blits via premultiplication. upstream #3276

Bugfixes

Deprecations, Potential Breaking Changes, and Removals

  • Python 3.6 support has been dropped. Thanks @yunline for implementing that in #1896 and #1936

  • pygame.display "gamma" functionality has been deprecated as it has been removed in the upcoming SDL3. Thanks @SSS-Says-Snek for implementing that in upstream #3622

  • pgScancodeWrapper now raises TypeError when you attempt to iterate over it, since iterating it is a footgun. Thanks to @PurityLake for implementing that in #1855

Docs, Examples, and Types

Cleanups and Robustness

Read more

2.1.4.dev2 - dev release for testing

27 Feb 16:48
ce96e88
Compare
Choose a tag to compare
Pre-release

This is a development pre-release for testing.

Please let us know of any issues on the issue tracker

What's Changed

Read more

2.1.3

14 Feb 07:28
Compare
Choose a tag to compare

💽🏴🍋⚫📀🖤💽🏴⚫📀🖤💽🏴🌞⚫📀🖤
pip install pygame-ce
📀👤💽🏴⚫📀🖤💽🏴🍋⚫📀🖤💽🏴🍋🔌
(pip uninstall pygame first to avoid contention)

Hello! This is the first release of pygame-ce-- pygame community edition, a pygame fork. See our reddit announcement for more of an explanation of the fork's goals and reason for existing.

The entirety of the code changes in this release were developed under the original pygame name. Most of these changes were actually developed by the contributors making this fork!

These changes represent the work on the pygame main branch between December of 2021 and October of 2022. (This release was supposed to happen back in October 2022 to add 3.11 support, but that didn't happen).

This changelog reflects the difference between pygame 2.1.2 and pygame-ce 2.1.3, with a few caveats. After these notes were written and the release was prepped, a couple memory leaks were discovered, and those patches have been added. Additionally, warning, font rendering doesn't work on macOS <= 11.0 in this release. We're aware of the problem and have a potential (if not ideal) fix drafted.

Release notes of 2.1.3, extremely long because of the long timescale covered:

Highlights

pygame on the Web

pygame now has source code support for WASM (web assembly)! @pmp-p is driving most of the work behind this, you can check their github profile to see a few pygame apps in action on the browser!

This is still a work-in-progress - more changes and fixes need doing before this will be a smooth experience. Existing pygame applications need a few minor changes to work on browsers.

See https://github.com/pygame-web/pygbag for more information.

Thanks to pmp-p for making this possible on the pygame end (pygame/pygame#3080, pygame/pygame#3104, pygame/pygame#3105, pygame/pygame#3106, pygame/pygame#3108, pygame/pygame#3191, pygame/pygame#3185, pygame/pygame#3115, pygame/pygame#3225, pygame/pygame#3246, pygame/pygame#3247, pygame/pygame#3349, pygame/pygame#3304), and thanks to the CPython team for making CPython 3.11 compile nicely on WASM.

Faster blitting

@MyreMylar has been hard at work to make some special flags for Surface.blit faster using SIMD instructions, and the results can be more than 10x faster on supported hardware! (pygame/pygame#2988, pygame/pygame#3136, pygame/pygame#3170, pygame/pygame#3181) @Starbuck5 followed in his footsteps improving blit blend mode efficiency slightly in pygame/pygame#3294 and getting a 15-20% boost for simple alpha blits in pygame/pygame#3378. There are more blitter improvements in the pipeline and we expect more boosts to alpha blending in 2.1.4.

Enhancements

A lot of nice additions and enhancements. There is some new API in this release, which currently have the experimental status. This release also has some performance enhancements (some of those are from updated dependencies, the performance changes on the pygame end are listed throughout the notes and not in this section)

New contributor @ThanhChinhBK made it possible to save surfaces with palettes as indexed 8P PNG in pygame/pygame#3028

New contributor @mariospapaz added font.get_sdl_ttf_version to check the underlying SDL_ttf library version in pygame/pygame#3095

New contributor @Emc2356 added pygame.image.(to|from)bytes (the same as (to|from)string but appropriately named) in pygame/pygame#3321

New contributor @rlatowicz added support for the BGRA format for image functions in pygame/pygame#3338 and pygame/pygame#3342. This should be helpul for pygame interoperability with pycairo!

New contributor @JamesC01 added math.clamp(val, min, max) in pygame/pygame#3326 and pygame/pygame#3361

Vectors have been receiving some nice polish thanks to the efforts of @novialriptide, who added move_towards() in pygame/pygame#2929 and clamp_magnitude in pygame/pygame#2990 and pygame/pygame#3133

@Starbuck5 added transform.scale_by and transform.smoothscale_by functions in pygame/pygame#2723

@dr0id added the parameter consider_alpha to transform.average_color to to remove black artifacts if alpha is present in pygame/pygame#2968. They also added a new rect method Rect.collidelistall in pygame/pygame#3026 and pygame/pygame#2989

@MightyJosip added a strikethrough option to Font in pygame/pygame#2991

@ankith26

  • Added precise_x and precise_y fields to MOUSEWHEEL events and also added some more pygame events in pygame/pygame#2953.
  • Made Rect and Color support collections.abc.Container in pygame/pygame#3066
  • Added use_compat to pygame.key.name, fixed key_code compat issues in pygame/pygame#3312

New contributor @itzpr3d4t0r cleaned up / optimized functions in the draw, math, and transform, and rect modules, resulting in some speedups for certain tasks. Check the PRs if you're interested. pygame/pygame#3300, pygame/pygame#3314, pygame/pygame#3335, pygame/pygame#3319, pygame/pygame#3401

@avaxar changed _sdl2.video.Image.flipX and .flipY to use snakecase in pygame/pygame#2978

Bug Fixes

This release comes with many bug fixes on the pygame side, but there should also be improvements due to bundling newer shinier versions of our dependencies.

New contributor @SnoopJ added checks to fail early if there are SDL version incompatibilities in pygame/pygame#2661

New contributor @Matiiss fixed windows version parsing in camera that errored on windows versions like 8.1 in pygame/pygame#3158

New contributor @ryanking13 fixed wasm build when no PREFIX variable is defined in pygame/pygame#3280

New contributor @PurityLake

@novialriptide

  • Fixed pygame Vector subclassing in pygame/pygame#3088. Now inherited methods return objects of the correct subtype.
  • Added Windows user fonts handling for pygame.font.match_font() in pygame/pygame#3184

@Starbuck5

@ankith26

  • Fixed UCS_4 UCS4 typo, incorrect color methods export and display.c error handling bugs in pygame/pygame#2987
  • Fixed a segfault in resource loading functions such as pygame.image.load in pygame/pygame#3089
  • Added a mutex to guard multithreaded functions in pygame.event and fixed allocation issues due to GIL in pygame/pygame#3177
  • font.get_fonts was returning a list None in some cases, this has now been fixed in pygame/pygame#3159. Now sysfont code also warns when there are underlying internal issues.
  • Made sure all functions in pygame.camera are defined at all times regardless init state and fixed a few more bugs around here in pygame/pygame#2961
  • Music load fails could trigger wrong errors, this was fixed to only raise pygame.error in pygame/pygame#3148
  • Internal function pgBuffer_Release now retains previously set errors in pygame/pygame#3127
  • Internal function v4l2_read_frame could raise python exceptions when it should not, fixed in pygame/pygame#3052
  • Fixed misnamed APPMOUSEFOCUS constand naming and updated the values in pygame/pygame#3043
  • Fixed Controller.rumble returning wrong bool on error in pygame/pygame#3248
  • Vendor in SDL PNG save function, fix new 2.1.3 regression in pygame/pygame#3376
  • Fixed an edge case bug in Vector.move_towards, add more tests in pygame/pygame#3400
  • Fixed segfault (due to incref issue) in PixelArray context manager API in pygame/pygame#3414
  • Delete rect subscripts should error not segfault in pygame/pygame#3440
  • Made sure display.set_mode always returns a cleared window in pygame/pygame#3317
  • Fixed pypy rect freelist issue, unskipped tests in pygame/pygame#3452
  • Fixed blitters compile error when missing SIMD in pygame/pygame#3498

@MightyJosip fixed a Vector memory leak in pygame/pygame#3236

@MyreMylar removed SIGALARM suppression in pygame/pygame#3142

Devops, Maintenance, and Cleanups

The pygame codebase has seen a lot of devops related changes, with many contributors helping with cleanups and maintenance. These changes would have also fixed a few rare bugs and such.

New contributor @SergioArnaud fixed dependencies not being found on PowerPC in pygame/pygame#2975.

New contributors @Yvant2000 and corrected a code comment in rect.c in pygame/pygame#3182

New contributor @GregoryMorse noticed VideoInfo string was missing closing parenthesis and fixed this in pygame/pygame#3053

New contributor @blankRiot96 removed an old use Python 2's __nonzero__ in pygame/pygame#3194

New contributor @blankRiot96 deprecated Color.set_length in pygame/pygame#3352

New contributor @itzpr3d4t0r ensured the CI continued to work by fixing a checksum in pygame/pygame#3329

New contributor @Vazno removed unused imports, fixed a confusing message, and improved some code in pygame/pygame#3382, pygame/pygame#3388, pygame/pygame#3397, and pygame/pygame#3392

New contributor @Matiiss replaced some truth testing with is not None checks in sprite module in pygame/pygame#3271

New contributor @kevin-pease removed deprecated blend argument from test and docs in pygame/pygame#3281

New contributor @lebedevhhh changed f strings (sysfont.py) in pygame/pygame#3391

@robertpfeiffer made buildconfig handle -auto flag in pygame/pygame#3157

@zold...

Read more