the code is as follow:
when I build and run the project in vs2010, the consol flapped rapidly full of gibberish and my speaker started to beep... what's wrong with it?
I run it by step and found it stopped at the "loadfromfile" line.
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML works!", sf::Style::Close);
sf::Texture txr;
if(!txr.loadFromFile("tank1.png"))
return -1;
sf::Sprite spr;
spr.setTexture(txr);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(spr);
window.display();
}
return 0;
}