How am I supposed to draw sprite in SFML 2.0?
in documentation there's something like this:
int wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR lpCmdLine, INT nShowCmd)
{
Window MainWindow(VideoMode(800, 600, 32), "SFML");
Sprite spr;
Texture txt;
txt.loadFromFile("Untitled.png");
spr.setTexture(txt);
spr.setPosition(100, 25);
while(MainWindow.isOpen())
{
Event Event;
while(MainWindow.waitEvent(Event))
{
if(Event.type == Event::Closed)
MainWindow.close();
}
MainWindow.draw(spr); // thisi s NOT working
MainWindow.display();
}
return 0;
}
I've been looking at sprite/window documentation for like hour now and I can't find draw() function anywhere...
error C2039: 'draw' : is not a member of 'sf::Window'
//spr.draw() isn't also working