I deleted what I've done after I saw it doesn't work. I recreated it and I think it's a bit better than before.
So, I have a class called Player. I initialized the texture in Player constructor :
if (!texture.create(100, 100))
std::cout << "error" << std::endl;
And then here is Player draw function :
void Player::draw()
{
texture.clear(sf::Color::White);
//Application::getInstance()->window.draw(shadow); <---- that's the draw call I've been using before
texture.draw(shadow);
Application::getInstance()->window.draw(body); // draw of the body (not the shadow)
//Application::getInstance()->window.draw(gunShadow); <-- draw call used before
texture.draw(gunShadow);
Application::getInstance()->window.draw(gun);
// Some bullets draw thing, not important
for (size_t i = 0; i < bullets.size(); i++)
{
Application::getInstance()->window.draw(bullets.at(i).getBody());
}
texture.display();
sf::Sprite sprite(texture.getTexture());
Application::getInstance()->window.draw(sprite);
}
Right now, it kinda looks like a mask or something, but the problem is obviously still there because I haven't used sf::BlendMode.
That's how it looks :