Hi,
I wrote this code:
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow sf_window(sf::VideoMode(1280, 720, 32), "Test");
sf::Event sf_event;
sf::Texture sf_texture;
sf_texture.loadFromFile("Background.png");
sf::Sprite sf_sprite(sf_texture);
while(sf_window.isOpen())
{
while(sf_window.pollEvent(sf_event))
if(sf_event.type == sf::Event::Closed)
sf_window.close();
sf_window.clear();
sf_window.draw(sf_sprite);
sf_window.display();
}
return 0;
}
I can compile and start the program, it tells me that sfml can’t open the file.
I tested it with g++ on my Linux and it worked perfectly, and because of that I think that I do something wrong with the path of the picture.
The image is in the location of the .pro file (Project file) and i think that qt creator should be able to find it.