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

Author Topic: sf::RenderImage problem (SFML2)  (Read 2080 times)

0 Members and 1 Guest are viewing this topic.

Tenchi

  • Newbie
  • *
  • Posts: 7
    • MSN Messenger - tenchi@hikago-fr.com
    • View Profile
    • http://www.soundclick.com/tenchi
sf::RenderImage problem (SFML2)
« on: May 06, 2010, 01:38:53 pm »
Hello everyone !

First of all, I'm pretty new to SFML and Cpp so please bare with me :D
I started developing a GUI for a project of mine some days ago with SFML 1.6. I then started to realize I needed some functions that were not present there. sf::RenderImage is exactly what I needed to do a buffer and then draw it on the screen.

My problem is that I want to resize my sf::RenderImage buffer each time I resize my widget on the screen. So I thought I could just redo buffer.Create(new X, new Y) all the time but it doesn't seem to resize anything : the rendered Image keeps the same size. I found a workaround by doing a sf::RenderImage that fills the whole screen but it isn't very clean..

Do I do something wrong ? Is it SFML 2 ? ^^

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
sf::RenderImage problem (SFML2)
« Reply #1 on: May 06, 2010, 02:23:18 pm »
The RenderImage is supposed to be resized accordingly, maybe it's just the sprite that displays it which is not resized (don't forget to call SetSubRect everytime the region to display changes)?
Laurent Gomila - SFML developer

Tenchi

  • Newbie
  • *
  • Posts: 7
    • MSN Messenger - tenchi@hikago-fr.com
    • View Profile
    • http://www.soundclick.com/tenchi
sf::RenderImage problem (SFML2)
« Reply #2 on: May 06, 2010, 02:41:36 pm »
It was that, thanks =]
My pseudo rich-text is approaching completion now ^^

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
sf::RenderImage problem (SFML2)
« Reply #3 on: May 06, 2010, 02:42:38 pm »
Great, don't forget to post something in the "projects" forum, or even on the wiki if the sources are available ;)
Laurent Gomila - SFML developer