Discussion
Loading...

Post

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Glyph
@glyph@mastodon.social  ·  activity timestamp last month

It's 2025 and I am still not 100% sure how to have #PyGame go to sleep and wait for either an event from the keyboard/mouse/controller or an event from the network or a vblank interrupt without some kind of hard-coded polling timeout. Various attempts I've made at this in the past have violated thread safety rules and I'm not sure the documentation even covers all the constraints I need to preserve. #python

  • Copy link
  • Flag this post
  • Block
Glyph
@glyph@mastodon.social replied  ·  activity timestamp last month

both https://pyga.me/docs/ref/event.html#pygame.event.post and https://www.pygame.org/docs/ref/event.html#pygame.event.post imply that I could call pygame.event.post() from a thread because they don't have the usual thread safety warning on them, but then, pygame.event.get doesn't have such a warning either, and it clearly should, because one of the flags literally says it's going to call another function that has such a warning if passed

  • Copy link
  • Flag this comment
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.0-rc.3.13 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login