Use cleaner constructor/destructor calls for ALCcontext
[openal-soft.git] / OpenAL32 / Include / alListener.h
blob1e0a82652b8a6b6419658fdbecf53692b6abf282
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 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 ATOMIC(ALenum) PropsClean{AL_TRUE};
33 /* Pointer to the most recent property values that are awaiting an update.
35 ATOMIC(ALlistenerProps*) Update{nullptr};
37 struct {
38 aluMatrixf Matrix;
39 aluVector 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