Skip to content

Update the arcade window so it resets gl context properly everyframe. #2752

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

Open
wants to merge 5 commits into
base: development
Choose a base branch
from

Conversation

DragonMoffon
Copy link
Collaborator

@DragonMoffon DragonMoffon commented Jul 15, 2025

This was discussed a while ago as part of the 3.0 changes. I put it off so that 3.0 could be released, and because there were larger issues with it to be solved. That work still needs doing.

The ArcadeContext reset method used by unit tests did not work well. It has now been updated to use the default camera rather than setting the Projection and View matrices manually.

The GL state was not being reset before every on_draw dispatch. This PR makes it so the gl state is reset, the screen's framebuffer is active, and the default camera is the active before every on_draw. The consequences of this change on examples and unit tests should be checked before the PR is merged.

Comment on lines 315 to 317
self.enable_only(self.BLEND)
self.blend_func = self.BLEND_DEFAULT
self.point_size = 1.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reset method was more for unit tests. We can still probably trim it down. These lines should definitly not be called every frame but they should be called in conftest between tests except that blending needs to disable instead.

I also don't know if it's necessary to bind the windowblock every frame but that should be done in unit tests.

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