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

Author Topic: RenderTexture -> RenderWindow  (Read 3382 times)

0 Members and 1 Guest are viewing this topic.

Qix

  • Full Member
  • ***
  • Posts: 139
  • I am Qix!
    • View Profile
    • Natoga Technologies
RenderTexture -> RenderWindow
« on: September 20, 2012, 04:10:18 pm »
What is the best way to blit/copy/draw a RenderTexture to/on a RenderWindow?

The only way I can see is to convert the RenderTexture to an Image and then draw the Image onto the RenderWindow.
~ Qix
Creator of Rippl Studio
Code: [Select]
<danharibo> iostream: I don't do enough drugs to think that's a good idea.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: RenderTexture -> RenderWindow
« Reply #1 on: September 20, 2012, 04:27:00 pm »
RenderTexture draws to a texture. Textures are drawn by sprites. So:

window.draw(sf::Sprite(renderTexture.getTexture()));

There's no "conversion" involved (that would be so slow...).
Laurent Gomila - SFML developer

Qix

  • Full Member
  • ***
  • Posts: 139
  • I am Qix!
    • View Profile
    • Natoga Technologies
Re: RenderTexture -> RenderWindow
« Reply #2 on: September 20, 2012, 04:27:33 pm »
There's the ticket. Thanks!
~ Qix
Creator of Rippl Studio
Code: [Select]
<danharibo> iostream: I don't do enough drugs to think that's a good idea.