Use proper classes for Vector and Matrix types
[openal-soft.git] / OpenAL32 / Include / alListener.h
blob490f15947cb5f37f0447d9ecf26b3fda22c20076
1 #ifndef _AL_LISTENER_H_
2 #define _AL_LISTENER_H_
4 #include "AL/alc.h"
5 #include "AL/al.h"
6 #include "AL/alext.h"
8 #include "atomic.h"
9 #include "vecmat.h"
11 enum class DistanceModel;
14 struct ALlistenerProps {
15 ALfloat Position[3];
16 ALfloat Velocity[3];
17 ALfloat Forward[3];
18 ALfloat Up[3];
19 ALfloat Gain;
21 std::atomic<ALlistenerProps*> next;
24 struct ALlistener {
25 ALfloat Position[3]{0.0f, 0.0f, 0.0f};
26 ALfloat Velocity[3]{0.0f, 0.0f, 0.0f};
27 ALfloat Forward[3]{0.0f, 0.0f, -1.0f};
28 ALfloat Up[3]{0.0f, 1.0f, 0.0f};
29 ALfloat Gain{1.0f};
31 std::atomic_flag PropsClean{true};
33 /* Pointer to the most recent property values that are awaiting an update.
35 std::atomic<ALlistenerProps*> Update{nullptr};
37 struct {
38 alu::Matrix Matrix;
39 alu::Vector Velocity;
41 ALfloat Gain;
42 ALfloat MetersPerUnit;
44 ALfloat DopplerFactor;
45 ALfloat SpeedOfSound; /* in units per sec! */
46 ALfloat ReverbSpeedOfSound; /* in meters per sec! */
48 ALboolean SourceDistanceModel;
49 DistanceModel mDistanceModel;
50 } Params;
53 void UpdateListenerProps(ALCcontext *context);
55 #endif