so i am very new to SFML (less then 24 hrs) and i have encountered with a weird problem. I am trying to load a texture and when i run my code, the cmd shows "failed to load ... " in the very beginning and then prints all sort of weird random gibberish stuff. I am using visual studio 2017 and SFML 2.5 . Also i found my working dir by using system(dir) and placed my png there but still doesnt work. also if i remove the "if condition" everything is fine. Here is my code :
#include <SFML/Graphics.hpp>
#include "iostream";
using namespace std;
using namespace sf;
int main()
{
RenderWindow window(VideoMode(1000, 1000), "Chiggy's Tic Tac Toe!");
CircleShape shape(100.f);
shape.setFillColor(Color::Blue);
Texture texture;
if (!texture.loadFromFile("D:\Developement\VisualStudio\sfml\try\Project0\Project0\mad.png")) {
cout<<"Mario failed to load horribly"<<endl; system("pause"); //return EXIT_FAILURE; }
while (window.isOpen()) {
Event event;
while (window.pollEvent(event)) {
if (event.type == Event::Closed)
window.close();
}
window.clear(Color::Black);
window.draw(shape);
window.display();
}
return 0; }