Hi! I've tried to create a function that can draw a SFML sprite directly onto the screen. The problem is that when I where going to use this function I didn't know that you couldn't pass a sf::RenderWindow to the pWindow parameter in that function. The compiler just generated a bunch of errors
.
This is how the function looks like and how I've thought it could work.
// Draw's the texture onto the screen
void TextureManger::DrawTexture(string id, sf::RenderWindow pWindow)
{
pWindow.clear(sf::Color::Black);
pWindow.draw(this->getSprite[id]);
pWindow.display();
}
But here is how I thought if using it which maybe were a bad idea
The window is of course a sf::RenderWindow.
DrawTexture("image", window);
First before I realized that I were using a sf::RenderWindow. I used a sf::Window. But when
I where going to create the function the sf::Window had no .clear(<COLOR>), .display() functions.
So I were forced to use a sf::RenderWindow instead.
Is it anyone who can help me out with this problem? Or have a solution to a function that can solve this problem? Thanks for help if so!