O'Reilly logo

Mastering SFML Game Development by Raimondas Pupius

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Sound system

Last, but definitely not least, the sound system deserves a brief overview. It probably would be a surprise to nobody at this point to learn that sounds are also reliant upon application states, which is why we're inheriting from StateDependent again:

class SoundManager : public StateDependent{ public: SoundManager(AudioManager* l_audioMgr); ~SoundManager(); void ChangeState(const StateType& l_state); void RemoveState(const StateType& l_state); void Update(float l_dT); SoundID Play(const std::string& l_sound, const sf::Vector3f& l_position, bool l_loop = false, bool l_relative = false); bool Play(const SoundID& l_id); bool Stop(const SoundID& l_id); bool Pause(const SoundID& l_id); bool PlayMusic(const std::string& l_musicId, float ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required