56 lines
1.1 KiB
C
Raw Normal View History

2007-11-13 18:02:18 -08:00
#ifndef _AL_LISTENER_H_
#define _AL_LISTENER_H_
#include "AL/alc.h"
#include "AL/al.h"
#include "AL/alext.h"
#include "atomic.h"
#include "vecmat.h"
2007-11-13 18:02:18 -08:00
enum class DistanceModel;
2007-11-13 18:02:18 -08:00
struct ALlistenerProps {
2017-03-08 03:38:28 -08:00
ALfloat Position[3];
ALfloat Velocity[3];
ALfloat Forward[3];
ALfloat Up[3];
ALfloat Gain;
2018-11-26 14:48:26 -08:00
std::atomic<ALlistenerProps*> next;
};
struct ALlistener {
ALfloat Position[3]{0.0f, 0.0f, 0.0f};
ALfloat Velocity[3]{0.0f, 0.0f, 0.0f};
ALfloat Forward[3]{0.0f, 0.0f, -1.0f};
ALfloat Up[3]{0.0f, 1.0f, 0.0f};
ALfloat Gain{1.0f};
2012-10-09 06:19:36 -07:00
std::atomic_flag PropsClean{true};
/* Pointer to the most recent property values that are awaiting an update.
*/
2018-11-26 14:48:26 -08:00
std::atomic<ALlistenerProps*> Update{nullptr};
2012-10-09 06:19:36 -07:00
struct {
2016-05-16 18:28:46 -07:00
aluMatrixf Matrix;
aluVector Velocity;
ALfloat Gain;
ALfloat MetersPerUnit;
ALfloat DopplerFactor;
ALfloat SpeedOfSound; /* in units per sec! */
ALfloat ReverbSpeedOfSound; /* in meters per sec! */
ALboolean SourceDistanceModel;
DistanceModel mDistanceModel;
2012-10-09 06:19:36 -07:00
} Params;
};
2007-11-13 18:02:18 -08:00
void UpdateListenerProps(ALCcontext *context);
2007-11-13 18:02:18 -08:00
#endif