Hi! I'm using SMFL (both 1.6 and 2.0, the latter through its .NET binding) to create software for psychology experiments, so the general architecture of my apps is typically different from that of a game. Most importantly, since there is no need for animation, I do not redraw the screen (render window) for each and every frame.
In terms of pseudocode, the main loop normally looks like this:
while (running)
{
ClearScreenAndDrawElements();
DisplayScreen();
WaitForUserInputOrTimeOut(); // this can take several seconds
}
99% of the time everything goes fine, but sometimes, quite unpredictably, the frame displayed does not appear the way it should. This happens most often in the first couple of frames, right after creating the SFML RenderWin. As I said in another post, sometimes the OS system tray appears on top of a full screen RenderWin, at other times, only some of the elements appear on a black background, and at yet other times, missing elements appear on the next frame as if the drawing operation could not finish and were deferred.
Obviously, these issues normally go unnoticed if you write a game and redraw your screen at 30 FPS.
I've been wondering if the Draw and Display methods run on different threads, and these phenomena could be due to some subtle synchronization issue...
Or, maybe what I do is simply not the way SFML is meant to be used?
Thanks for your help in advance.
Gabor