Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - learner

Pages: [1]
1
Graphics / Re: NonCopyable error when passing sf::RenderWindow to a function
« on: September 19, 2012, 12:08:28 pm »
Thank you!
That worked out!

2
Graphics / NonCopyable error when passing sf::RenderWindow to a function
« on: September 19, 2012, 11:57:47 am »
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.

Pages: [1]