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

Fix #22316: Always recreate the window when changing drawing engine #22522

Merged
merged 3 commits into from
Aug 12, 2024

Conversation

ZehMatt
Copy link
Member

@ZehMatt ZehMatt commented Aug 9, 2024

We have to always create a new window as SDL has some lingering state left on it even when if we free all SDL related handles.

Closes #22316

@ZehMatt ZehMatt added this to the v0.4.14 milestone Aug 9, 2024
@ZehMatt ZehMatt added the changelog This issue/PR deserves a changelog entry. label Aug 9, 2024
@Gymnasiast Gymnasiast added the testing required PR needs to be tested before it is merged. label Aug 11, 2024
@Gymnasiast
Copy link
Member

@Basssiiie Does this fix the problem for you?

@Basssiiie
Copy link
Member

I have no crashes anymore when switching drawing engines in this build. 🙂

I do get this new stdout error on launch if my drawing engine is set to OpenGL, and occasionally when switching to OpenGL from another drawing engine as well, which I haven't seen before:

ERROR[D:\a\OpenRCT2\OpenRCT2\src\openrct2-ui\drawing\engines\opengl\OpenGLAPI.h:123 (OpenRCT2::Ui::CheckGLError)]: OpenGL Error 0x0501

@Gymnasiast
Copy link
Member

I get that error on startup, but also on develop. Occasionally, it even segfaults (again, on develop).

@ZehMatt
Copy link
Member Author

ZehMatt commented Aug 11, 2024

I will have to look into what that error is about, it doesn't seem like there is anything wrong tho.

@Gymnasiast
Copy link
Member

Do you want to address that in this PR or in another? Since it happens on develop too, I’m happy to merge this PR as-is.

@Basssiiie
Copy link
Member

Basssiiie commented Aug 11, 2024

The error must be quite recent then (~ maybe added past week) because I had not seen it before. 😯

@ZehMatt
Copy link
Member Author

ZehMatt commented Aug 11, 2024

The place where it checks the error is not the actual place where the error is generated, this needs a bit of digging to what specific OpenGL API calls causes that error so I think its best to ignore it for the time being, it might be something related to the line drawing. I think we can merge this as is as the error is not persistent and isn't coming from this PR.

Copy link
Member

@Basssiiie Basssiiie left a comment

Choose a reason for hiding this comment

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

In that case, LGTM!

@Gymnasiast Gymnasiast enabled auto-merge (squash) August 12, 2024 21:49
@Gymnasiast Gymnasiast merged commit 06501b0 into OpenRCT2:develop Aug 12, 2024
22 checks passed
@ZehMatt ZehMatt deleted the fix-22316 branch August 13, 2024 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog This issue/PR deserves a changelog entry. testing required PR needs to be tested before it is merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Game crash when switching from "Software" to "Software (Hardware display)"
3 participants