I have tested without setScale and in that case it does show the sprite (tho only a part of it fits the window).
Here's the code:
void Game::showSplash()
{
sf::Texture splash_txt;
if (!splash_txt.loadFromFile("splash.jpg"))
{
std::cout << "Cant load splash" << std::endl;
}
sf::Sprite splash_spr;
splash_spr.setTexture(splash_txt);
splash_spr.setScale(xscale, yscale);
mainWindow.draw(splash_spr);
sf::Clock clock;
while (clock.getElapsedTime().asSeconds() < 10)
{
mainWindow.display();
}
gameState = GameState::MAIN_MENU;
}
xscale and yscale are static variables from the class Game. I also have tried with different combinations of display(), draw() and clear(), such as:
mainWindow.clear();
mainWindow.draw(splash_spr);
mainWindow.display();
What am I doing wrong? D: