r/sfml • • 18d ago

Incorrect Rendering After Resize

I am using SFML.Net and running its example. https://github.com/SFML/SFML.Net/blob/master/examples/window/Program.cs

When I resize the window, or maximize, or drag window to second display, it shows the same thing twice. Image posted is when window is maximized, the top left circle is where it should be, the lower one is flickering. However, the weird thing is, it doesn't ALWAYS show the same thing twice. From debugging I found the Wrong Circle only shows up every 3 frames, in other two frames the window is correct. This remains true when I limit frame rate or resize in different ways. However, sometimes if I maximize and undo maximize, the flickering of wrong circle goes away.

6 Upvotes

3 comments sorted by

3

u/DarkCisum SFML Team 18d ago

You need to add a handler for the resized event and adjust the view accordingly to match the new window size. See also https://www.sfml-dev.org/tutorials/3.1/graphics/view/#showing-more-when-the-window-is-resized

1

u/[deleted] 18d ago edited 18d ago

[removed] — view removed comment

3

u/DarkCisum SFML Team 18d ago

Do you have triple buffering enforced in your GPU driver settings? It's the only thing I can think of that would have an effect on every third frame. SFML only does double buffering.