SFML community forums

Help => Graphics => Topic started by: Lamonte on July 26, 2013, 07:54:44 am

Title: sf::RenderTexture, why is the update method called "display" ?
Post by: Lamonte on July 26, 2013, 07:54:44 am
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
Title: Re: sf::RenderTexture, why is the update method called "display" ?
Post by: Laurent on July 26, 2013, 08:24:52 am
For consistency. It's the same display() as in sf::RenderWindow.
Title: Re: sf::RenderTexture, why is the update method called "display" ?
Post by: Lamonte 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.
Title: Re: sf::RenderTexture, why is the update method called "display" ?
Post by: Ancurio 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.
Title: Re: sf::RenderTexture, why is the update method called "display" ?
Post by: Laurent 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).