I'm getting kinda mad at sfml 2.0. I set up my sprite stuff JUST LIKE the Docs said to. and i get "error: no matching function call for (sf::Sprite::Sprite(sf::Image&)
here's my code.
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include <cstdio>
#include <cstdlib>
#include <iostream>
int main(int argc, char**argv)
{
sf::RenderWindow app(sf::VideoMode(800,640), "Sfml works!");
sf::Text text("Welcome to SFML 2.0");
text.setPosition(400,320);
sf::Image terrain;
if(terrain.loadFromFile("terrain.png"))
{
return EXIT_FAILURE;
}
sf::Sprite grass(terrain);
grass.setTextureRect(IntRect(0,0,45,45);
grass.setX(100,100);
while(app.isOpen())
{
sf::Event Event;
while(app.pollEvent(Event))
{
if(Event.type == sf::Event::Closed)
{
app.close();
}
}
app.clear();
app.draw(grass);
app.draw(text);
app.display();
}
return 0;
}