-
-
Notifications
You must be signed in to change notification settings - Fork 1k
[OpenGL] Fixed window resizing and GraphicsAdapter.Outputs not being properly populated #2845
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
base: master
Are you sure you want to change the base?
[OpenGL] Fixed window resizing and GraphicsAdapter.Outputs not being properly populated #2845
Conversation
@DockFrankenstein the inconsistent behavior issue you linked has been commented on yesterday, any thoughts on what they said ? |
@Eideren Sorry, I'm not sure which issue you are talking about |
This one libsdl-org/SDL#13149 |
Okay I read it. Seems like this is a "sort of" intended behavior. I'm gonna have to look into this more and hopefully create a better, more proper fix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not very knowledgeable in OpenGL, and I cannot test these changes right now, but if it works and has been tested, it looks good enough for me. Just left some comments.
Maybe the weird order in which SDL calls ResizeBeginActions
is related with the other issue in which the SDL backend does weird things for full-screen mode? I don't know for suer. Ignore this if not.
sources/engine/Stride.Graphics/OpenGL/SwapChainGraphicsPresenter.OpenGL.cs
Show resolved
Hide resolved
sources/engine/Stride.Graphics/OpenGL/SwapChainGraphicsPresenter.OpenGL.cs
Show resolved
Hide resolved
sources/engine/Stride.Graphics/OpenGL/SwapChainGraphicsPresenter.OpenGL.cs
Show resolved
Hide resolved
…he engine if the size of the window changed.
…dow to be either fullscreen or normal, which broke maximizing
…he fullscreen one
31366e0
to
71cb13b
Compare
After a comment from @Eideren, I decided to look into how the engine handles resizing to figure out why I had to do the original hack in the first place. I already explained the issue in the discord server, but the gist is: previously, we incorrectly assumed what Here is the correct description:
References: [ forum post ] [ sdl documentation ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Just that you forgot to change the comment.
Do you think there's something that could be done to the SDL backend to better convey the difference? Or to better document it? In the future, when Silk supports SDL3, it should be rewritten or improved. |
@Ethereal77 I'm not sure. I think just changing the names of the events is enough. We could perhaps write a better summary comment for those |
PR Details
This PR fixes a crash that would occur when trying to resize a window on OpenGL, other issues with resizing the depth buffer, a fix to
GraphicsAdapter.Outputs
not being populated with the right values and a refactor to how SDL window resize events are handledRelated PRs
Related Issue
Types of changes
Checklist