2007-11-13 18:02:18 -08:00
|
|
|
#ifndef _AL_LISTENER_H_
|
|
|
|
#define _AL_LISTENER_H_
|
|
|
|
|
2012-09-14 02:42:36 -07:00
|
|
|
#include "alMain.h"
|
2014-12-16 06:29:31 -08:00
|
|
|
#include "alu.h"
|
2007-11-13 18:02:18 -08:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2016-05-11 18:40:17 -07:00
|
|
|
struct ALlistenerProps {
|
|
|
|
ATOMIC(ALfloat) Position[3];
|
|
|
|
ATOMIC(ALfloat) Velocity[3];
|
|
|
|
ATOMIC(ALfloat) Forward[3];
|
|
|
|
ATOMIC(ALfloat) Up[3];
|
|
|
|
ATOMIC(ALfloat) Gain;
|
|
|
|
ATOMIC(ALfloat) MetersPerUnit;
|
|
|
|
|
|
|
|
ATOMIC(ALfloat) DopplerFactor;
|
|
|
|
ATOMIC(ALfloat) DopplerVelocity;
|
|
|
|
ATOMIC(ALfloat) SpeedOfSound;
|
|
|
|
|
|
|
|
ATOMIC(struct ALlistenerProps*) next;
|
|
|
|
};
|
|
|
|
|
2012-10-09 04:48:12 -07:00
|
|
|
typedef struct ALlistener {
|
2016-05-11 18:40:17 -07:00
|
|
|
volatile ALfloat Position[3];
|
|
|
|
volatile ALfloat Velocity[3];
|
2011-09-11 01:26:09 -07:00
|
|
|
volatile ALfloat Forward[3];
|
|
|
|
volatile ALfloat Up[3];
|
2011-08-31 00:33:33 -07:00
|
|
|
volatile ALfloat Gain;
|
|
|
|
volatile ALfloat MetersPerUnit;
|
2012-10-09 06:19:36 -07:00
|
|
|
|
2016-05-11 18:40:17 -07:00
|
|
|
/* Pointer to the most recent property values that are awaiting an update.
|
|
|
|
*/
|
|
|
|
ATOMIC(struct ALlistenerProps*) Update;
|
|
|
|
|
|
|
|
/* A linked list of unused property containers, free to use for future
|
|
|
|
* updates.
|
|
|
|
*/
|
|
|
|
ATOMIC(struct ALlistenerProps*) FreeList;
|
|
|
|
|
2012-10-09 06:19:36 -07:00
|
|
|
struct {
|
2016-05-16 18:28:46 -07:00
|
|
|
aluMatrixf Matrix;
|
2015-11-11 08:19:33 -08:00
|
|
|
aluVector Velocity;
|
2016-05-09 11:26:49 -07:00
|
|
|
|
|
|
|
ALfloat Gain;
|
|
|
|
ALfloat MetersPerUnit;
|
|
|
|
|
|
|
|
ALfloat DopplerFactor;
|
|
|
|
ALfloat SpeedOfSound;
|
2012-10-09 06:19:36 -07:00
|
|
|
} Params;
|
2007-11-13 18:02:18 -08:00
|
|
|
} ALlistener;
|
|
|
|
|
2016-05-11 18:40:17 -07:00
|
|
|
void UpdateListenerProps(ALCcontext *context);
|
|
|
|
|
2007-11-13 18:02:18 -08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|