#include "stdafx.h"
#include <iostream>
#include <SFML/Graphics.hpp>
int main(){
sf::VideoMode videomode(800, 800);
sf::RenderWindow window(videomode, "game");
sf::Sprite sprite;
sf::Texture texture;
texture.loadFromFile("Images\catz.png");
sprite.setTexture(texture);
sprite.setPosition(200, 200);
while (window.isOpen()){
window.clear();
window.draw(sprite);
window.display();
sf::Event event;
while (window.pollEvent(event)){
if ((event.type == sf::Event::Closed))
window.close();
}
}
}
Image is in:-
Documents\Visual Studio 2013\Projects\ConsoleApplication1\ConsoleApplication1\Images
The working directory is the project directory.
Why isn't this working? I've tried Images '//' and '\\' and '/' and '\' but none is working, the program displays a black window instead,could anyone please help?