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

Author Topic: too much text problem  (Read 6066 times)

0 Members and 1 Guest are viewing this topic.

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: too much text problem
« Reply #15 on: April 13, 2014, 06:51:01 pm »
I hadn't fully realized before that you're texturing the rectangle with the rendertexture's texture.  That seems like a dubious/fragile design choice (maintaining a std::string and just drawing an sf::Text would be a LOT easier, and probably safer/faster/etc than this rendertexture stuff) but I guess it should still work.

I don't remember if the texture produced by getTexture() is truly separate from the rendertexture, so drawing it to the same rendertexture it came from might not be safe.  I can't see anything in the docs or tutorials that seems to cover this case; another sign this isn't normal usage.

Someone in here is bound to know for sure, but if you want to test that theory right away, maybe use an sf::Image member instead to force the texture to get copied to main memory?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: too much text problem
« Reply #16 on: April 13, 2014, 09:00:18 pm »
Quote
I don't remember if the texture produced by getTexture() is truly separate from the rendertexture, so drawing it to the same rendertexture it came from might not be safe.
Rendering a texture to itself is not allowed. But from what I've seen, that's not what he does: he makes a copy of the render-target's texture, so the source and target textures are two separate objects.
Laurent Gomila - SFML developer