I'm getting the following error when trying to pass sf::RenderWindow to a function.
I've gone throw few of the thread, but haven't been able to fix it yet.
Here are the errors :
/usr/local/include/SFML/System/NonCopyable.hpp:67: error: 'sf::NonCopyable::NonCopyable(const sf::NonCopyable&)' is private
and here's my source:
#include <SFML/Graphics.hpp>
void myFunc(sf::RenderWindow &window, sf::Vector2f size)
{
sf::RectangleShape rect;
rect.setSize(size);
rect.setPosition(20.f,20.f);
window.draw(rect,sf::RenderStates::Default);
}
int main()
{
sf::RenderWindow win= sf::RenderWindow(sf::VideoMode(320,480,32),"My win");
myFunc(win,sf::Vector2f(40,40));
while(win.isOpen())
{
sf::Event event;
while(win.pollEvent(event))
{
if(event.type==sf::Event::KeyPressed)
win.close();
}
// win.clear();
win.display();
}
return EXIT_SUCCESS;
}
Please do point out where I'm doing wrong.
Thanks.