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

Author Topic: sf::RenderTexture, why is the update method called "display" ?  (Read 1705 times)

0 Members and 1 Guest are viewing this topic.

Lamonte

  • Newbie
  • *
  • Posts: 46
    • View Profile
Wouldn't the "display" function be described better as "update" since that's exactly what it does according to the description?

Quote
void    display ()
    Update the contents of the target texture.
http://sfml-dev.org/documentation/2.0/classsf_1_1RenderTexture.php

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: sf::RenderTexture, why is the update method called "display" ?
« Reply #1 on: July 26, 2013, 08:24:52 am »
For consistency. It's the same display() as in sf::RenderWindow.
Laurent Gomila - SFML developer

Lamonte

  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: sf::RenderTexture, why is the update method called "display" ?
« Reply #2 on: July 26, 2013, 11:17:09 am »
You should change both to update, to better represent their use clearer source wise.  Pretty sure neither class uses an update method so there wouldn't/shouldn't be any issues.

Just a suggestion for future updates IMHO.

Ancurio

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: sf::RenderTexture, why is the update method called "display" ?
« Reply #3 on: July 26, 2013, 11:21:05 am »
You should change both to update, to better represent their use clearer source wise.  Pretty sure neither class uses an update method so there wouldn't/shouldn't be any issues.

Just a suggestion for future updates IMHO.

Uh, pls no.

There's nothing worse than a generic "update()" that could be updating any state or none. For a RenderWindow, "display()" is pretty intuitive, and as Laurent said RenderTexture inherits that name for consistency.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: sf::RenderTexture, why is the update method called "display" ?
« Reply #4 on: July 26, 2013, 11:40:50 am »
Yep.

Update can mean many different things so in the end it means nothing at all. Display tells exactly what the function does: it takes everything that you've drawn so far and displays it on the final target (screen or texture).
Laurent Gomila - SFML developer

 

anything