2019-07-28 21:29:59 -07:00
|
|
|
#ifndef AL_LISTENER_H
|
|
|
|
#define AL_LISTENER_H
|
2007-11-13 18:02:18 -08:00
|
|
|
|
2018-12-26 22:27:34 -08:00
|
|
|
#include <array>
|
2019-07-28 21:29:59 -07:00
|
|
|
#include <atomic>
|
2018-12-26 22:27:34 -08:00
|
|
|
|
2018-11-17 23:21:37 -08:00
|
|
|
#include "AL/al.h"
|
2019-07-28 21:29:59 -07:00
|
|
|
#include "AL/alc.h"
|
2019-08-05 22:40:19 -07:00
|
|
|
#include "AL/efx.h"
|
2018-11-17 23:21:37 -08:00
|
|
|
|
2019-08-13 20:33:44 -07:00
|
|
|
#include "almalloc.h"
|
2021-04-15 15:07:14 -07:00
|
|
|
#include "atomic.h"
|
2007-11-13 18:02:18 -08:00
|
|
|
|
2016-05-11 18:40:17 -07:00
|
|
|
|
2018-11-17 23:21:37 -08:00
|
|
|
struct ALlistener {
|
2020-04-08 10:15:43 -07:00
|
|
|
std::array<float,3> Position{{0.0f, 0.0f, 0.0f}};
|
|
|
|
std::array<float,3> Velocity{{0.0f, 0.0f, 0.0f}};
|
|
|
|
std::array<float,3> OrientAt{{0.0f, 0.0f, -1.0f}};
|
|
|
|
std::array<float,3> OrientUp{{0.0f, 1.0f, 0.0f}};
|
|
|
|
float Gain{1.0f};
|
|
|
|
float mMetersPerUnit{AL_DEFAULT_METERS_PER_UNIT};
|
2012-10-09 06:19:36 -07:00
|
|
|
|
2021-04-15 15:07:14 -07:00
|
|
|
al::atomic_invflag mPropsDirty;
|
2017-09-27 09:36:34 -07:00
|
|
|
|
2021-04-15 15:07:14 -07:00
|
|
|
ALlistener() { mPropsDirty.test_and_clear(std::memory_order_relaxed); }
|
2020-03-23 16:00:50 -07:00
|
|
|
|
|
|
|
DISABLE_ALLOC()
|
2018-11-17 23:21:37 -08:00
|
|
|
};
|
2007-11-13 18:02:18 -08:00
|
|
|
|
2016-05-11 18:40:17 -07:00
|
|
|
void UpdateListenerProps(ALCcontext *context);
|
|
|
|
|
2007-11-13 18:02:18 -08:00
|
|
|
#endif
|