I am using SDL3. I have written an application based around the SDL_AppInit, SDL_AppIterate, SDL_AppEvent and SDL_AppQuit functions.
I assume this concept has a “proper name”, but I don’t know what to call it.
When I click and drag the border of my application window, it causes a stretching effect. The effect is not large, but it is noticeable.
The reason I begin this post by mentioning the above 4 functions is because using these functions solves a similar, but more severe, version of this problem.
That is to say, if one writes an SDL application using the usual C++ int main() function in combination with a while loop which polls for SDL Events using SDL_PollEvent then the following behavior is observed.
- Start to click-drag window border
- SDL event loop freezes
- Drag window border, app remains frozen, rendered content will be a stretched copy of the last image which was rendered to the SDL Window drawable area
- Stop dragging window border
- SDL_EVENT_WINDOW_RESIZED event is fired
- App window will unfreeze, events will resume processing
- Some event will cause window to re-draw, now the stretched frozen image is replaced by the up-to-date window contents
It’s really hard to describe this problem, but it has been discussed in other threads.
The problem I am facing is very similar to this but not exactly the same.
As recommended in the above linked thread, I am using the 4 SDL functions mentioned at the top of this post.
I still find that there is a very small stretching effect which occurs when resizing a window.
This is what I think happens:
- When the window size is changed by 1 pixel, the contents of the window framebuffer is replaced by a stretched version of the last drawn framebuffer
- The window resize event fires
- Later, the window rendering function fires
- The window is redrawn
Because there is some delay between the resize event firing and the window drawing function being called, this causes a small stretching artifact effect









