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

Author Topic: problems with copying renderTextures  (Read 1245 times)

0 Members and 1 Guest are viewing this topic.

soaup

  • Newbie
  • *
  • Posts: 5
    • View Profile
problems with copying renderTextures
« on: January 09, 2016, 01:28:19 pm »
Hello and sorry for bad english! I had tried implement multiple shaders as described herein, but use RenderTexture. And it is not copied.

how i tried:
Quote
foreach (sf::Shader *shader, globalShaders) {
        front.clear();
        sf::Sprite sprite(back.getTexture());
        front.draw(sprite, shader);
        front.display();

        sf::RenderTexture temp = front;
        front = back;
        back = temp;
    }
And this error
Quote
C:\SFML\include\SFML\System\NonCopyable.hpp:67: error: 'sf::NonCopyable::NonCopyable(const sf::NonCopyable&)' is private
     NonCopyable(const NonCopyable&);
     ^
the problem disappears if you comment out the line
Quote
//sf::RenderTexture temp = front;
        //front = back;
        //back = temp;
Please answer - what is the problem?

SpeCter

  • Full Member
  • ***
  • Posts: 151
    • View Profile
Re: problems with copying renderTextures
« Reply #1 on: January 09, 2016, 01:44:58 pm »
sf::RenderTexture temp = front;
front = back;
back = temp;

You are in fact trying to copy the RenderTexture around.
The other thread uses pointers(which can be copied) to do what you want.

Not trying to be rude here, but you should get a fundamental knowledge about C++ first.

soaup

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: problems with copying renderTextures
« Reply #2 on: January 09, 2016, 03:16:19 pm »
Yes, i did it with pointers and it works. I forgot pointers.

 

anything