Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweaks to examples #610

Merged
merged 2 commits into from
Oct 2, 2024
Merged

Tweaks to examples #610

merged 2 commits into from
Oct 2, 2024

Conversation

almarklein
Copy link
Member

@almarklein almarklein commented Oct 2, 2024

  • Refactor triangle.py and cube.py so that they return the draw function. This means that the canvas needs nothing more than WgpuCanvasInterface, which is nice and clean.
  • The examples that use triangle or cube, call canvas.request_draw() or call the draw function on their own terms.
  • The draw function returned by the async setup-method, is also async.
  • Tweaked cube.py so it used buffer.map(), so we can run something that is actually async.
  • Implemented a workaround for a bug that left destroyed glfw windows on screen on macos.

Side note

I observed the following warning when using glfw:

2024-10-02 16:13:41.233 python[40243:5114401] +[IMKClient subclass]: chose IMKClient_Legacy
2024-10-02 16:13:41.233 python[40243:5114401] +[IMKInputSession subclass]: chose IMKInputSession_Legacy

I checked that this happens inside glfw.poll_events and a quick Google suggests it is related to the latest MacOS Sequoia update. So nothing we can do on our end.

@almarklein almarklein marked this pull request as ready for review October 2, 2024 14:19
@almarklein almarklein changed the title Teaks to examples Tweaks to examples Oct 2, 2024
@almarklein almarklein merged commit 55d3dfd into main Oct 2, 2024
20 checks passed
@almarklein almarklein deleted the examples branch October 2, 2024 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants