File: alListener.h

package info (click to toggle)
openal-soft 1:1.19.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 3,580 kB
  • sloc: ansic: 49,037; cpp: 2,781; makefile: 51; sh: 36
file content (67 lines) | stat: -rw-r--r-- 1,340 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef _AL_LISTENER_H_
#define _AL_LISTENER_H_

#include "alMain.h"
#include "alu.h"

#ifdef __cplusplus
extern "C" {
#endif

struct ALcontextProps {
    ALfloat DopplerFactor;
    ALfloat DopplerVelocity;
    ALfloat SpeedOfSound;
    ALboolean SourceDistanceModel;
    enum DistanceModel DistanceModel;
    ALfloat MetersPerUnit;

    ATOMIC(struct ALcontextProps*) next;
};

struct ALlistenerProps {
    ALfloat Position[3];
    ALfloat Velocity[3];
    ALfloat Forward[3];
    ALfloat Up[3];
    ALfloat Gain;

    ATOMIC(struct ALlistenerProps*) next;
};

typedef struct ALlistener {
    alignas(16) ALfloat Position[3];
    ALfloat Velocity[3];
    ALfloat Forward[3];
    ALfloat Up[3];
    ALfloat Gain;

    ATOMIC_FLAG PropsClean;

    /* Pointer to the most recent property values that are awaiting an update.
     */
    ATOMIC(struct ALlistenerProps*) Update;

    struct {
        aluMatrixf Matrix;
        aluVector  Velocity;

        ALfloat Gain;
        ALfloat MetersPerUnit;

        ALfloat DopplerFactor;
        ALfloat SpeedOfSound; /* in units per sec! */
        ALfloat ReverbSpeedOfSound; /* in meters per sec! */

        ALboolean SourceDistanceModel;
        enum DistanceModel DistanceModel;
    } Params;
} ALlistener;

void UpdateListenerProps(ALCcontext *context);

#ifdef __cplusplus
}
#endif

#endif