Loading [MathJax]/extensions/tex2jax.js
Free Electron
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
alListener.h
1 #ifndef _AL_LISTENER_H_
2 #define _AL_LISTENER_H_
3 
4 #include "alMain.h"
5 #include "alu.h"
6 
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10 
11 struct ALcontextProps {
12  ALfloat DopplerFactor;
13  ALfloat DopplerVelocity;
14  ALfloat SpeedOfSound;
15  ALboolean SourceDistanceModel;
16  enum DistanceModel DistanceModel;
17  ALfloat MetersPerUnit;
18 
19  ATOMIC(struct ALcontextProps*) next;
20 };
21 
22 struct ALlistenerProps {
23  ALfloat Position[3];
24  ALfloat Velocity[3];
25  ALfloat Forward[3];
26  ALfloat Up[3];
27  ALfloat Gain;
28 
29  ATOMIC(struct ALlistenerProps*) next;
30 };
31 
32 typedef struct ALlistener {
33  alignas(16) ALfloat Position[3];
34  ALfloat Velocity[3];
35  ALfloat Forward[3];
36  ALfloat Up[3];
37  ALfloat Gain;
38 
39  ATOMIC_FLAG PropsClean;
40 
41  /* Pointer to the most recent property values that are awaiting an update.
42  */
43  ATOMIC(struct ALlistenerProps*) Update;
44 
45  struct {
46  aluMatrixf Matrix;
47  aluVector Velocity;
48 
49  ALfloat Gain;
50  ALfloat MetersPerUnit;
51 
52  ALfloat DopplerFactor;
53  ALfloat SpeedOfSound; /* in units per sec! */
54  ALfloat ReverbSpeedOfSound; /* in meters per sec! */
55 
56  ALboolean SourceDistanceModel;
57  enum DistanceModel DistanceModel;
58  } Params;
59 } ALlistener;
60 
61 void UpdateListenerProps(ALCcontext *context);
62 
63 #ifdef __cplusplus
64 }
65 #endif
66 
67 #endif