Game Development Reference
In-Depth Information
The sf::Sound class has another feature, which is utilized by calling
Sound::setPlayingOffset() . The method takes sf::Time and sets the playing
position to that time. It can be used in both paused and playing state.
There is something important that we need to talk about in more detail and that is resource
management. As it is, with the Texture and Sprite classes, the SoundBuffer in-
stance has to be alive and stay in the same memory location while Sound is using it. To
easily manage the lifetime of a sf::Texture object, we used our AssetManager
class, and we will do the same for SoundBuffer .
Search WWH ::




Custom Search