SFML community forums
General => General discussions => Topic started by: Jebbs on May 19, 2013, 05:41:21 pm
-
I'm not sure if this was intentional or not, and I don't know how I have missed this until now, but I feel like there is a naming inconsistency with how Music's loading methods are named.
Everything I checked in the graphical module, plus even the SoundBuffer class' loading methods are named loadFromXXX, but only Music's methods are named openFromXXX.
Not that it really matters or has any kind of serious impact. I was just curious!
-
I think (but could be very wrong) that some music things can be streamed from the disk. Hence, they're not loaded all at once. "Open" makes more sense if the data is streamed.
-
I was actually thinking this right after I posted. I'm pretty sure you are right. The music class does stream when it plays, so "open" would make more sense than "load."
Thanks for the quick reply!
-
The real inconsistency however is that sf::Font uses loadFromFile(), although it has similar semantics to sf::Music: The source must remain valid throughout the whole usage.