]> git.tdb.fi Git - ext/openal.git/blob - al/buffer.h
Import OpenAL Soft 1.23.1 sources
[ext/openal.git] / al / buffer.h
1 #ifndef AL_BUFFER_H
2 #define AL_BUFFER_H
3
4 #include <atomic>
5
6 #include "AL/al.h"
7
8 #include "albyte.h"
9 #include "alc/inprogext.h"
10 #include "almalloc.h"
11 #include "atomic.h"
12 #include "core/buffer_storage.h"
13 #include "vector.h"
14
15 #ifdef ALSOFT_EAX
16 #include "eax/x_ram.h"
17
18 enum class EaxStorage : uint8_t {
19     Automatic,
20     Accessible,
21     Hardware
22 };
23 #endif // ALSOFT_EAX
24
25
26 struct ALbuffer : public BufferStorage {
27     ALbitfieldSOFT Access{0u};
28
29     al::vector<al::byte,16> mDataStorage;
30
31     ALuint OriginalSize{0};
32
33     ALuint UnpackAlign{0};
34     ALuint PackAlign{0};
35     ALuint UnpackAmbiOrder{1};
36
37     ALbitfieldSOFT MappedAccess{0u};
38     ALsizei MappedOffset{0};
39     ALsizei MappedSize{0};
40
41     ALuint mLoopStart{0u};
42     ALuint mLoopEnd{0u};
43
44     /* Number of times buffer was attached to a source (deletion can only occur when 0) */
45     RefCount ref{0u};
46
47     /* Self ID */
48     ALuint id{0};
49
50     DISABLE_ALLOC()
51
52 #ifdef ALSOFT_EAX
53     EaxStorage eax_x_ram_mode{EaxStorage::Automatic};
54     bool eax_x_ram_is_hardware{};
55 #endif // ALSOFT_EAX
56 };
57
58 #endif