Description
I have live resize implemented in my 'traditional' style / while-loop-and-polling app, via an SDL event watcher that listens for SDL_EVENT_WINDOW_EXPOSED
and redraws.
This sort of works but introduces issues including stuttering during resizes, because the app ends up redrawing from inside the SDL_EVENT_WINDOW_EXPOSED
event in situations where the event didn't originate from a live-resize OS notification, and those situations can be pretty frequent even during a resize.
I'm testing a local change to SDL_OnWindowLiveResizeUpdate
which just sends 1
instead of 0
for the event.window.data1
event field. When my code detects that and only redraws if it is 1
, the issues I've been having go away.
If that change is desired, I could make a pull request for it - I think it shouldn't introduce any backwards incompatibilities since the data1
field wasn't being used for anything meaningful in the expose event before. Or if people have better ideas I'm interested in those too. :)
The code in SDL is here:
Lines 4136 to 4145 in 7d9fd48
I haven't looked much at how it all works with a callback-style app instead of a traditional one, so I'm not sure if a similar idea would be useful there or not.