A have a List<Sprite> that it's used to draw on the main RenderWindow object. Currently, this list holds 2 sprite and I call a window.Draw(sprite) for each one. Also, they are big as the RenderWindow object in width and height.
public void Draw(RenderWindow window)
{
foreach (Sprite sprite in currentArea.AreaSprites)
{
window.Draw(sprite);
}
}So far so good, until this happens after a couple of seconds, for no apparent reason:
Since the guy continues running, I though that the sprites are having some problems.
The only clue that I have was an AccessViolationException, something that I couldn't reproduce later and that was thrown right after the problem above occurred. The stack trace had something about a thread being started, in root, and I don't know if it have something to do.
I'm curious if all SFML calls are thread safe, since it seems to be locking the resource memory from me.
And also, how many times is it safe to call the Draw() method?
Sorry for being asking, I didn't found anything related on the forum.