SFML community forums
Help => Graphics => Topic started by: T.T.H. on February 11, 2010, 05:02:16 pm
-
Is there any reason why sf::Image::Reset() is private?
I'd could make good use of it if it would be public and by having a (short) look at the code I did only see Reset() being called after an error.
-
Why would you want an empty, invalid instance of sf::Image?
Anyway, this solution should work too:
image = sf::Image();
-
Why would you want an empty, invalid instance of sf::Image?
Because I might want to free the dynamic memory of the image without destructing the image (class) itself as it might be part of some resource management structure which I don't want to change at that point.
Anyway, this solution should work too:
image = sf::Image();
Yeah, should work, but... ugh...
Wouldn't it be simpler to make Reset() public? Maybe you want to keep the public interface as small as possible so you can change the internals without breaking the interface, but in my opinion a reset function for images makes enough sense to have it in the public interface.
-
A Reset() function in a class usually doesn't sound right. If you want an empty instance then create one with the default constructor, that looks much cleaner to me.
I should even use it in my implementation, and get rid of Reset().