#include <SFML/Graphics.hpp>
#include <iostream>
int main()
{
sf::RenderWindow Window(sf::VideoMode(800, 600, 32), "Title");
sf::Texture mytexture;
sf::Sprite mysprite;
mytexture.loadFromFile("theimage.bmp");
mysprite.setTexture(mytexture, 0);
while (Window.isOpen())
{
sf::Event Event;
while(Window.pollEvent(Event))
{
if(Event.type == sf::Event::Closed || Event.key.code == sf::Keyboard::Escape)
Window.close();
}
Window.clear();
Window.draw(mysprite);
Window.display();
sf::sleep(sf::milliseconds(60));
}
return 0;
}
I cant really seem to figure it out when i look in the documentation
When i run it, it gives me those "dot" sounds every 0.4 sec, and then there come a box where there stand i can break, continue or ignore.
In the console window there stand "failed to load image".
I have put the image in the folder where my .cpp is.