The sound listener component

In order to properly implement spatial sounds, there has to be a listener within our game world. That listener is, of course, the player of the game. Fortunately, there isn't a lot of information we need to process or store when creating a component for an audio listener:

class C_SoundListener : public C_Base{
public:
    C_SoundListener() : C_Base(Component::SoundListener){}
    void ReadIn(std::stringstream& l_stream){}
private:

};

Yes, that's it! In its most essential form, this class simply represents a sign that its owner entity should be treated as a listener in the auditory world.

Get SFML Game Development By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.