-
Notifications
You must be signed in to change notification settings - Fork 14
Process system events before drawing #39
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: main
Are you sure you want to change the base?
Conversation
|
It may be more prudent to somehow always call Still, this seems to have stopped the crashes I was experiencing, for now. |
|
I don't think it's a good idea to do this. Instead, I think we should just not provide this callback and the client should be expected to always use the size value returned by AcquireSwapchainTexture. This is because SDL has its own window size change filter that it uses to determine the size of the swapchain, so that value will always be up to date. |
|
As some additional explanation, doing this would be bad mostly because it would cause input events to be gathered long before they are processed. |
|
|
|
To address your points, I'll drop my current proposal for another. I propose first keeping the callback, but internally calling it whenever we call
|
This is useful so that users have the most up-to-date information regarding the window.
For example, without this, it's possible for the
Windowclass'SizeChangeCallbackto not be called before the Draw function, which could cause a crash if the user's Draw function assumes that the swapchain's width/height are the same as the last reported values from theSizeChangeCallback/ the values reported by the game's main Window (as I experienced, for a region-based blit).