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

Author Topic: RenderTexture resize  (Read 3731 times)

0 Members and 1 Guest are viewing this topic.

Qix

  • Full Member
  • ***
  • Posts: 139
  • I am Qix!
    • View Profile
    • Natoga Technologies
RenderTexture resize
« on: September 30, 2012, 11:10:44 am »
Is the easiest way of resizing a RenderTexture to simply delete/recreate it with the new size?

Also, can you call create() twice?
~ Qix
Creator of Rippl Studio
Code: [Select]
<danharibo> iostream: I don't do enough drugs to think that's a good idea.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: RenderTexture resize
« Reply #1 on: September 30, 2012, 11:17:56 am »
Yes (*) and yes.  ;)

(*) if you simply want de scale the produced texture you can use sf::Sprite::SetScale() or sf::Sprite::scale() methods instead or recreating your RenderTexture.
SFML / OS X developer

Qix

  • Full Member
  • ***
  • Posts: 139
  • I am Qix!
    • View Profile
    • Natoga Technologies
Re: RenderTexture resize
« Reply #2 on: September 30, 2012, 11:22:29 am »
True about the scale, but a new texture is the way to go.

Does create() dispose of the old texture in memory?
~ Qix
Creator of Rippl Studio
Code: [Select]
<danharibo> iostream: I don't do enough drugs to think that's a good idea.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: RenderTexture resize
« Reply #3 on: September 30, 2012, 11:27:10 am »
Yes, of course.
SFML / OS X developer

Qix

  • Full Member
  • ***
  • Posts: 139
  • I am Qix!
    • View Profile
    • Natoga Technologies
Re: RenderTexture resize
« Reply #4 on: September 30, 2012, 11:40:47 am »
Cool, just what I needed! Thanks!
~ Qix
Creator of Rippl Studio
Code: [Select]
<danharibo> iostream: I don't do enough drugs to think that's a good idea.

 

anything