Sorry for the confusion. I'll try to be more specific.
The computation thread call an user defined method to change the texture of a sprite. (It's not my real code but it's in the spirit)
void MyClass::SetFrame(sf::Texture& texture)
{
m_Sprite.setTexture(texture);
}
The rendering thread call the declaration of the draw method.
void MyClass::draw (sf::RenderTarget &target, sf::RenderStates states) const
{
target.draw(m_Sprite, states);
}
So, maybe it may occur a collision when the first thread update the texture and the other display the sprite at the same time. This collision can it occur? And if so, how can I avoid it?
Thanks