Ok i can start my Programm but it says still that he cant find the image
#include <SFML/Graphics.hpp>
#include <iostream>
int main()
{
sf::RenderWindow Window(sf::VideoMode(800, 600, 32), "Blockjump");
sf::Event Event;
sf::Texture SFigur;
sf::Sprite PImage;
if (!SFigur.loadFromFile("C:\\Programmiersachen\\sfml\\bin\\Debug\\Spielfigur.png",sf::IntRect(0, 0, 128, 32)))
{
std::cout << "Player Image cant load!";
}
PImage.setTexture(SFigur);
while (Window.isOpen())
{
while(Window.pollEvent(Event))
{
if(Event.type == Event.KeyPressed);
{
if(Event.key.code == sf::Keyboard::Escape)
{
Window.close();
}
}
}
Window.clear(sf::Color(255,255,255));
Window.draw(PImage);
Window.display();
}
return 0;
}
he says in the console unable to open file!
Maybe you should try put your image into the directory of your project (near your source like "source.cpp") and write only
if (!SFigur.loadFromFile("Spielfigur.png"))
{
//errore
}
It works by myself..