Hey everyone,
I'm new to SFML, and just bought that book about game programming with SFML,
but i have some problems.
Here is the code:
#include <SFML/Graphics.hpp>
using namespace sf;
int main()
{
VideoMode vm(1920, 1080);
RenderWindow window(vm, "Timber", Style::Fullscreen);
Texture textureBackground;
textureBackground.loadFromFile("assets/graphics/background.png");
Sprite spriteBackground;
spriteBackground.setTexture(textureBackground);
spriteBackground.setPosition(0, 0);
while (window.isOpen())
{
if (Keyboard::isKeyPressed(Keyboard::Escape))
{
window.close();
}
window.clear();
window.draw(spriteBackground);
window.display();
}
return 0;
}
The thing is that i cant load the background.
This is the message i get: "The requested video mode is not available, switching to a valid mode
w╠їя 8 ". Reason: Unable to open file"
Where am i wrong?
And just to note, i've tried moving the png file everywhere and still no success