Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
General
»
Feature requests
»
sf::image constructor that allows to initialize an imagefile
Print
Pages: [
1
]
Author
Topic: sf::image constructor that allows to initialize an imagefile (Read 2681 times)
0 Members and 1 Guest are viewing this topic.
kingcools
Jr. Member
Posts: 57
sf::image constructor that allows to initialize an imagefile
«
on:
December 27, 2013, 01:56:42 pm »
hi,
just stumbled upon this, is there a reason there is no
sf
::
image
(
std
::
string
filename
)
{
loadImage
(
filename
)
;
}
constructor in the sf::image class? Would be nice to have in my opinion.
Logged
Nexus
SFML Team
Hero Member
Posts: 6287
Thor Developer
Re: sf::image constructor that allows to initialize an imagefile
«
Reply #1 on:
December 27, 2013, 02:36:20 pm »
Yes, such a constructor has two disadvantages:
It is less expressive and possibly ambiguous (consider
sf::Shader
which can be loaded from a file or from a string), thus one should consider the named constructor idiom.
SFML 2 doesn't use exceptions, so there is no way to report errors.
Logged
Zloxx II
: action platformer
Thor Library
: particle systems, animations, dot products, ...
SFML Game Development
:
Print
Pages: [
1
]
SFML community forums
»
General
»
Feature requests
»
sf::image constructor that allows to initialize an imagefile