Process system events before drawing#39
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).