zenilib: zenilib/jni/external/zenilib/zeni_audio/Sound_Renderer_AL.cpp Source File

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Sound_Renderer_AL.cpp
Go to the documentation of this file.
1 /* This file is part of the Zenipex Library (zenilib).
2 * Copyright (C) 2011 Mitchell Keith Bloch (bazald).
3 *
4 * zenilib is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * zenilib is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with zenilib. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 #include <zeni_audio.h>
19
20 #include <iostream>
21 #include <vector>
22 #include <iomanip>
23
24 #ifndef _WINDOWS
25 #include <dlfcn.h>
26 #endif
27
28 #ifndef DISABLE_AL
29
30 #define OV_EXCLUDE_STATIC_CALLBACKS
31 #include <vorbis/vorbisfile.h>
32 #undef OV_EXCLUDE_STATIC_CALLBACKS
33
34 namespace Zeni {
35
36 #ifdef _LINUX
37 static void * LoadLibrary(const char * const &file) {
38 return dlopen(file, RTLD_LAZY);
39 }
40
41 static int FreeLibrary(void * const &handle) {
42 return dlclose(handle);
43 }
44
45 static void * GetProcAddress(void * const &handle, const char * const & name) {
46 return dlsym(handle, name);
47 }
48 #endif
49
50 Sound_Renderer_AL::Sound_Renderer_AL()
51 : m_device(0),
52 m_context(0),
53 m_bgm(0),
54 m_bgm_source(0)
55 {
56 #ifndef _MACOSX
57 #ifdef _WINDOWS
58 m_openal32 = LoadLibrary("OpenAL32.dll");
59 if(!m_openal32)
60 m_openal32 = LoadLibrary("soft_oal.dll");
61 #else
62 m_openal32 = LoadLibrary("libopenal.so");
63 if(!m_openal32)
64 m_openal32 = LoadLibrary("libopenal.so.1");
65 #endif
66 if(!m_openal32) {
67 std::cerr << "Locating OpenAL32.dll/libopenal.so failed." << std::endl;
68
69 throw Sound_Init_Failure();
70 }
71
72 g_alBufferData = (alBufferData_fcn)GetProcAddress(m_openal32, "alBufferData");
73 g_alcCloseDevice = (alcCloseDevice_fcn)GetProcAddress(m_openal32, "alcCloseDevice");
74 g_alcCreateContext = (alcCreateContext_fcn)GetProcAddress(m_openal32, "alcCreateContext");
75 g_alcDestroyContext = (alcDestroyContext_fcn)GetProcAddress(m_openal32, "alcDestroyContext");
76 g_alIsExtensionPresent = (alIsExtensionPresent_fcn)GetProcAddress(m_openal32, "alIsExtensionPresent");
77 g_alcMakeContextCurrent = (alcMakeContextCurrent_fcn)GetProcAddress(m_openal32, "alcMakeContextCurrent");
78 g_alcOpenDevice = (alcOpenDevice_fcn)GetProcAddress(m_openal32, "alcOpenDevice");
79 g_alDeleteBuffers = (alDeleteBuffers_fcn)GetProcAddress(m_openal32, "alDeleteBuffers");
80 g_alDeleteSources = (alDeleteSources_fcn)GetProcAddress(m_openal32, "alDeleteSources");
81 g_alGenBuffers = (alGenBuffers_fcn)GetProcAddress(m_openal32, "alGenBuffers");
82 g_alGetError = (alGetError_fcn)GetProcAddress(m_openal32, "alGetError");
83 g_alGetListenerf = (alGetListenerf_fcn)GetProcAddress(m_openal32, "alGetListenerf");
84 g_alGetListenerfv = (alGetListenerfv_fcn)GetProcAddress(m_openal32, "alGetListenerfv");
85 g_alGetSourcef = (alGetSourcef_fcn)GetProcAddress(m_openal32, "alGetSourcef");
86 g_alGetSourcefv = (alGetSourcefv_fcn)GetProcAddress(m_openal32, "alGetSourcefv");
87 g_alGetSourcei = (alGetSourcei_fcn)GetProcAddress(m_openal32, "alGetSourcei");
88 g_alGenSources = (alGenSources_fcn)GetProcAddress(m_openal32, "alGenSources");
89 g_alListenerf = (alListenerf_fcn)GetProcAddress(m_openal32, "alListenerf");
90 g_alListenerfv = (alListenerfv_fcn)GetProcAddress(m_openal32, "alListenerfv");
91 g_alSourcef = (alSourcef_fcn)GetProcAddress(m_openal32, "alSourcef");
92 g_alSourcefv = (alSourcefv_fcn)GetProcAddress(m_openal32, "alSourcefv");
93 g_alSourcei = (alSourcei_fcn)GetProcAddress(m_openal32, "alSourcei");
94 g_alSourcePause = (alSourcePause_fcn)GetProcAddress(m_openal32, "alSourcePause");
95 g_alSourcePlay = (alSourcePlay_fcn)GetProcAddress(m_openal32, "alSourcePlay");
96 g_alSourceStop = (alSourceStop_fcn)GetProcAddress(m_openal32, "alSourceStop");
97 g_alSourceQueueBuffers = (alSourceQueueBuffers_fcn)GetProcAddress(m_openal32, "alSourceQueueBuffers");
98 g_alSourceUnqueueBuffers = (alSourceUnqueueBuffers_fcn)GetProcAddress(m_openal32, "alSourceUnqueueBuffers");
99 if(!g_alBufferData || !g_alcCloseDevice || !g_alcCreateContext || !g_alcDestroyContext ||
100 !g_alIsExtensionPresent || !g_alcMakeContextCurrent || !g_alcOpenDevice || !g_alDeleteBuffers ||
101 !g_alDeleteSources || !g_alGenBuffers || !g_alGetError || !g_alGetListenerf ||
102 !g_alGetListenerfv || !g_alGetSourcef || !g_alGetSourcefv || !g_alGetSourcei ||
103 !g_alGenSources || !g_alListenerf || !g_alListenerfv || !g_alSourcef ||
104 !g_alSourcefv || !g_alSourcei || !g_alSourcePause || !g_alSourcePlay ||
105 !g_alSourceStop || !g_alSourceQueueBuffers || !g_alSourceUnqueueBuffers)
106 {
107 std::cerr << "Loading OpenAL32.dll/libopenal.so failed." << std::endl;
108
109 zero_handles();
110 FreeLibrary(m_openal32);
111
112 throw Sound_Init_Failure();
113 }
114 #else
115 g_alBufferData = (alBufferData_fcn)::alBufferData;
116 g_alcCloseDevice = (alcCloseDevice_fcn)::alcCloseDevice;
117 g_alcCreateContext = (alcCreateContext_fcn)::alcCreateContext;
118 g_alcDestroyContext = (alcDestroyContext_fcn)::alcDestroyContext;
119 g_alIsExtensionPresent = (alIsExtensionPresent_fcn)::alIsExtensionPresent;
120 g_alcMakeContextCurrent = (alcMakeContextCurrent_fcn)::alcMakeContextCurrent;
121 g_alcOpenDevice = (alcOpenDevice_fcn)::alcOpenDevice;
122 g_alDeleteBuffers = (alDeleteBuffers_fcn)::alDeleteBuffers;
123 g_alDeleteSources = (alDeleteSources_fcn)::alDeleteSources;
124 g_alGenBuffers = (alGenBuffers_fcn)::alGenBuffers;
125 g_alGetError = (alGetError_fcn)::alGetError;
126 g_alGetListenerf = (alGetListenerf_fcn)::alGetListenerf;
127 g_alGetListenerfv = (alGetListenerfv_fcn)::alGetListenerfv;
128 g_alGetSourcef = (alGetSourcef_fcn)::alGetSourcef;
129 g_alGetSourcefv = (alGetSourcefv_fcn)::alGetSourcefv;
130 g_alGetSourcei = (alGetSourcei_fcn)::alGetSourcei;
131 g_alGenSources = (alGenSources_fcn)::alGenSources;
132 g_alListenerf = (alListenerf_fcn)::alListenerf;
133 g_alListenerfv = (alListenerfv_fcn)::alListenerfv;
134 g_alSourcef = (alSourcef_fcn)::alSourcef;
135 g_alSourcefv = (alSourcefv_fcn)::alSourcefv;
136 g_alSourcei = (alSourcei_fcn)::alSourcei;
137 g_alSourcePause = (alSourcePause_fcn)::alSourcePause;
138 g_alSourcePlay = (alSourcePlay_fcn)::alSourcePlay;
139 g_alSourceStop = (alSourceStop_fcn)::alSourceStop;
140 g_alSourceQueueBuffers = (alSourceQueueBuffers_fcn)::alSourceQueueBuffers;
141 g_alSourceUnqueueBuffers = (alSourceUnqueueBuffers_fcn)::alSourceUnqueueBuffers;
142 #endif
143
144 m_device = alcOpenDevice()(0);
145 if(!m_device) {
146 zero_handles();
147 #ifndef _MACOSX
148 FreeLibrary(m_openal32);
149 #endif
150
151 throw Sound_Init_Failure();
152 }
153
154 m_context = alcCreateContext()(m_device, 0);
155 if(!m_context) {
156 alcCloseDevice()(m_device);
157
158 zero_handles();
159 #ifndef _MACOSX
160 FreeLibrary(m_openal32);
161 #endif
162
163 throw Sound_Init_Failure();
164 }
165
166 if(!alcMakeContextCurrent()(m_context)) {
167 alcDestroyContext()(m_context);
168 alcCloseDevice()(m_device);
169
170 zero_handles();
171 #ifndef _MACOSX
172 FreeLibrary(m_openal32);
173 #endif
174
175 throw Sound_Init_Failure();
176 }
177
178 // Check for Vorbis extension functionality; seems to always fail :(
179 alIsExtensionPresent()("AL_EXT_vorbis");
180 //cerr << "Valid Audio Formats: " << alutGetMIMETypes(ALUT_LOADER_BUFFER) << std::endl;
181
182 ALfloat listener_position[] = {0.0f, 0.0f, 0.0f};
183 ALfloat listener_velocity[] = {0.0f, 0.0f, 0.0f};
184 ALfloat listener_forward_and_up[] = {1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f};
185
186 alListenerfv()(AL_POSITION, listener_position);
187 alListenerfv()(AL_VELOCITY, listener_velocity);
188 alListenerfv()(AL_ORIENTATION, listener_forward_and_up);
189 }
190
191 Sound_Renderer_AL::~Sound_Renderer_AL() {
192 alcDestroyContext()(m_context);
193 alcCloseDevice()(m_device);
194
195 #ifndef _MACOSX
196 FreeLibrary(m_openal32);
197 #endif
198
199 zero_handles();
200 }
201
202 String Sound_Renderer_AL::errorString(const ALenum &err) {
203 switch(err) {
204 case AL_NO_ERROR: return "AL_NO_ERROR"; break;
205 case AL_INVALID_NAME: return "AL_INVALID_NAME"; break;
206 case AL_INVALID_ENUM: return "AL_INVALID_ENUM"; break;
207 case AL_INVALID_VALUE: return "AL_INVALID_VALUE"; break;
208 case AL_INVALID_OPERATION: return "AL_INVALID_OPERATION"; break;
209 case AL_OUT_OF_MEMORY: return "AL_OUT_OF_MEMORY"; break;
210 default: return "AL_UNKNOWN_ERROR"; break;
211 }
212 }
213
214 String Sound_Renderer_AL::errorString() {
215 if(Sound_Renderer_AL::alGetError())
216 return errorString(Sound_Renderer_AL::alGetError()());
217 else
218 return "OpenAL not initialized";
219 }
220
221 void Sound_Renderer_AL::set_listener_position(const Point3f &position) {
222 ALfloat listener_position[3] = {position.x, position.y, position.z};
223 alListenerfv()(AL_POSITION, listener_position);
224 }
225
226 void Sound_Renderer_AL::set_listener_velocity(const Vector3f &velocity) {
227 ALfloat listener_velocity[3] = {velocity.i, velocity.j, velocity.k};
228 alListenerfv()(AL_VELOCITY, listener_velocity);
229 }
230
231 void Sound_Renderer_AL::set_listener_forward_and_up(const Vector3f &forward, const Vector3f &up) {
232 ALfloat listener_forward_and_up[6] = {forward.i, forward.j, forward.k, up.i, up.j, up.k};
233 alListenerfv()(AL_ORIENTATION, listener_forward_and_up);
234 }
235
236 void Sound_Renderer_AL::set_listener_gain(const float &gain) {
237 alListenerf()(AL_GAIN, gain);
238 }
239
240 std::pair<Vector3f, Vector3f> Sound_Renderer_AL::get_listener_forward_and_up() const {
241 ALfloat lfau[6] = {1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f};
242 alGetListenerfv()(AL_ORIENTATION, lfau);
243 return std::make_pair(Vector3f(lfau[0], lfau[1], lfau[2]), Vector3f(lfau[3], lfau[4], lfau[5]));
244 }
245
246 void Sound_Renderer_AL::zero_handles() {
247 g_alBufferData = 0;
248 g_alcCloseDevice = 0;
249 g_alcCreateContext = 0;
250 g_alcDestroyContext = 0;
251 g_alIsExtensionPresent = 0;
252 g_alcMakeContextCurrent = 0;
253 g_alcOpenDevice = 0;
254 g_alDeleteBuffers = 0;
255 g_alDeleteSources = 0;
256 g_alGenBuffers = 0;
257 g_alGetError = 0;
258 g_alGetListenerf = 0;
259 g_alGetListenerfv = 0;
260 g_alGetSourcef = 0;
261 g_alGetSourcefv = 0;
262 g_alGetSourcei = 0;
263 g_alGenSources = 0;
264 g_alListenerf = 0;
265 g_alListenerfv = 0;
266 g_alSourcef = 0;
267 g_alSourcefv = 0;
268 g_alSourcei = 0;
269 g_alSourcePause = 0;
270 g_alSourcePlay = 0;
271 g_alSourceStop = 0;
272 g_alSourceQueueBuffers = 0;
273 g_alSourceUnqueueBuffers = 0;
274 }
275
276 Sound_Renderer_AL::alBufferData_fcn Sound_Renderer_AL::g_alBufferData = 0;
277 Sound_Renderer_AL::alcCloseDevice_fcn Sound_Renderer_AL::g_alcCloseDevice = 0;
278 Sound_Renderer_AL::alcCreateContext_fcn Sound_Renderer_AL::g_alcCreateContext = 0;
279 Sound_Renderer_AL::alcDestroyContext_fcn Sound_Renderer_AL::g_alcDestroyContext = 0;
280 Sound_Renderer_AL::alIsExtensionPresent_fcn Sound_Renderer_AL::g_alIsExtensionPresent = 0;
281 Sound_Renderer_AL::alcMakeContextCurrent_fcn Sound_Renderer_AL::g_alcMakeContextCurrent = 0;
282 Sound_Renderer_AL::alcOpenDevice_fcn Sound_Renderer_AL::g_alcOpenDevice = 0;
283 Sound_Renderer_AL::alDeleteBuffers_fcn Sound_Renderer_AL::g_alDeleteBuffers = 0;
284 Sound_Renderer_AL::alDeleteSources_fcn Sound_Renderer_AL::g_alDeleteSources = 0;
285 Sound_Renderer_AL::alGenBuffers_fcn Sound_Renderer_AL::g_alGenBuffers = 0;
286 Sound_Renderer_AL::alGetError_fcn Sound_Renderer_AL::g_alGetError = 0;
287 Sound_Renderer_AL::alGetListenerf_fcn Sound_Renderer_AL::g_alGetListenerf = 0;
288 Sound_Renderer_AL::alGetListenerfv_fcn Sound_Renderer_AL::g_alGetListenerfv = 0;
289 Sound_Renderer_AL::alGetSourcef_fcn Sound_Renderer_AL::g_alGetSourcef = 0;
290 Sound_Renderer_AL::alGetSourcefv_fcn Sound_Renderer_AL::g_alGetSourcefv = 0;
291 Sound_Renderer_AL::alGetSourcei_fcn Sound_Renderer_AL::g_alGetSourcei = 0;
292 Sound_Renderer_AL::alGenSources_fcn Sound_Renderer_AL::g_alGenSources = 0;
293 Sound_Renderer_AL::alListenerf_fcn Sound_Renderer_AL::g_alListenerf = 0;
294 Sound_Renderer_AL::alListenerfv_fcn Sound_Renderer_AL::g_alListenerfv = 0;
295 Sound_Renderer_AL::alSourcef_fcn Sound_Renderer_AL::g_alSourcef = 0;
296 Sound_Renderer_AL::alSourcefv_fcn Sound_Renderer_AL::g_alSourcefv = 0;
297 Sound_Renderer_AL::alSourcei_fcn Sound_Renderer_AL::g_alSourcei = 0;
298 Sound_Renderer_AL::alSourcePause_fcn Sound_Renderer_AL::g_alSourcePause = 0;
299 Sound_Renderer_AL::alSourcePlay_fcn Sound_Renderer_AL::g_alSourcePlay = 0;
300 Sound_Renderer_AL::alSourceStop_fcn Sound_Renderer_AL::g_alSourceStop = 0;
301 Sound_Renderer_AL::alSourceQueueBuffers_fcn Sound_Renderer_AL::g_alSourceQueueBuffers = 0;
302 Sound_Renderer_AL::alSourceUnqueueBuffers_fcn Sound_Renderer_AL::g_alSourceUnqueueBuffers = 0;
303
304 }
305
306 #else
307
308 namespace Zeni {
309 void * this_pointer_is_silent_sound = (void *)0xDEADBEEF;
310 }
311
312 #endif
alSourcePlay
AL_API void AL_APIENTRY alSourcePlay(ALuint source)
Definition: alSource.c:1894
Zeni::Sound_Renderer_AL::set_listener_position
void set_listener_position(const Point3f &position)
Set the position of the listener and BGM.
Definition: Sound_Renderer_AL.cpp:221
Zeni::Sound_Renderer_AL::alBufferData_fcn
void(AL_APIENTRY * alBufferData_fcn)(ALuint bid, ALenum format, const ALvoid *data, ALsizei size, ALsizei freq)
Definition: Sound_Renderer_AL.h:52
Zeni::Sound_Renderer_AL::alSourcePause_fcn
void(AL_APIENTRY * alSourcePause_fcn)(ALuint sid)
Definition: Sound_Renderer_AL.h:74
Zeni::Sound_Renderer_AL::alListenerf
static alListenerf_fcn alListenerf()
Definition: Sound_Renderer_AL.h:98
Zeni::Sound_Renderer_AL::alSourceUnqueueBuffers_fcn
void(AL_APIENTRY * alSourceUnqueueBuffers_fcn)(ALuint sid, ALsizei numEntries, ALuint *bids)
Definition: Sound_Renderer_AL.h:78
alBufferData
AL_API void AL_APIENTRY alBufferData(ALuint buffer, ALenum format, const ALvoid *data, ALsizei size, ALsizei freq)
Definition: alBuffer.c:289
Zeni::Sound_Renderer_AL::alcDestroyContext
static alcDestroyContext_fcn alcDestroyContext()
Definition: Sound_Renderer_AL.h:84
Zeni::Sound_Renderer_AL::alIsExtensionPresent_fcn
ALboolean(AL_APIENTRY * alIsExtensionPresent_fcn)(const ALchar *extname)
Definition: Sound_Renderer_AL.h:56
alcMakeContextCurrent
ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent(ALCcontext *context)
Definition: ALc.c:2590
alcCloseDevice
ALC_API ALCboolean ALC_APIENTRY alcCloseDevice(ALCdevice *Device)
Definition: ALc.c:2884
AL_INVALID_VALUE
#define AL_INVALID_VALUE
Definition: al.h:373
Zeni::Sound_Renderer_AL::alListenerfv_fcn
void(AL_APIENTRY * alListenerfv_fcn)(ALenum param, const ALfloat *values)
Definition: Sound_Renderer_AL.h:70
alGetError
AL_API ALenum AL_APIENTRY alGetError(void)
Definition: alError.c:46
Zeni::Sound_Renderer_AL::alcOpenDevice_fcn
ALCdevice *(ALC_APIENTRY * alcOpenDevice_fcn)(const ALCchar *devicename)
Definition: Sound_Renderer_AL.h:58
alGetSourcei
AL_API void AL_APIENTRY alGetSourcei(ALuint source, ALenum param, ALint *value)
Definition: alSource.c:1754
alcDestroyContext
ALC_API ALCvoid ALC_APIENTRY alcDestroyContext(ALCcontext *context)
Definition: ALc.c:2539
file
FILE * file
Definition: visualinfo.c:88
Zeni::Sound_Renderer_AL::alcMakeContextCurrent_fcn
ALCboolean(ALC_APIENTRY * alcMakeContextCurrent_fcn)(ALCcontext *context)
Definition: Sound_Renderer_AL.h:57
name
EGLImageKHR EGLint * name
Definition: eglext.h:284
Zeni::Sound_Renderer_AL::alGetListenerfv
static alGetListenerfv_fcn alGetListenerfv()
Definition: Sound_Renderer_AL.h:93
Zeni::Sound_Renderer_AL::alGetError_fcn
ALenum(AL_APIENTRY * alGetError_fcn)(void)
Definition: Sound_Renderer_AL.h:62
Zeni::Sound_Renderer_AL::alSourcei_fcn
void(AL_APIENTRY * alSourcei_fcn)(ALuint sid, ALenum param, ALint value)
Definition: Sound_Renderer_AL.h:73
ALfloat
float ALfloat
Definition: al.h:68
alGenSources
AL_API void AL_APIENTRY alGenSources(ALsizei n, ALuint *sources)
Definition: alSource.c:1216
AL_POSITION
#define AL_POSITION
Definition: al.h:144
Zeni::Sound_Renderer_AL::get_listener_forward_and_up
std::pair< Vector3f, Vector3f > get_listener_forward_and_up() const
Set the orientation of the listener.
Definition: Sound_Renderer_AL.cpp:240
Zeni::String
Definition: String.h:29
Zeni::Sound_Renderer_AL::alGetSourcefv_fcn
void(AL_APIENTRY * alGetSourcefv_fcn)(ALuint sid, ALenum param, ALfloat *values)
Definition: Sound_Renderer_AL.h:66
alListenerf
AL_API void AL_APIENTRY alListenerf(ALenum param, ALfloat value)
Definition: alListener.c:29
Zeni::Sound_Renderer_AL::alGenBuffers_fcn
void(AL_APIENTRY * alGenBuffers_fcn)(ALsizei n, ALuint *buffers)
Definition: Sound_Renderer_AL.h:61
Zeni::Point3f
A 3D Point represented with floats.
Definition: Coordinate.h:133
Zeni::Sound_Renderer_AL::alcCloseDevice_fcn
ALCboolean(ALC_APIENTRY * alcCloseDevice_fcn)(ALCdevice *device)
Definition: Sound_Renderer_AL.h:53
Zeni::Sound_Renderer_AL::set_listener_velocity
void set_listener_velocity(const Vector3f &velocity)
Set the velocity of the listener and BGM for the doppler effect.
Definition: Sound_Renderer_AL.cpp:226
alSourceStop
AL_API void AL_APIENTRY alSourceStop(ALuint source)
Definition: alSource.c:1985
Zeni::Vector3f
A Featureful 3-Space Vector Class.
Definition: Vector3f.h:58
Zeni::Sound_Renderer_AL::alGetSourcei_fcn
void(AL_APIENTRY * alGetSourcei_fcn)(ALuint sid, ALenum param, ALint *value)
Definition: Sound_Renderer_AL.h:67
Zeni::Sound_Renderer_AL::alSourcePlay_fcn
void(AL_APIENTRY * alSourcePlay_fcn)(ALuint sid)
Definition: Sound_Renderer_AL.h:75
alGetSourcefv
AL_API void AL_APIENTRY alGetSourcefv(ALuint source, ALenum param, ALfloat *values)
Definition: alSource.c:1655
AL_INVALID_NAME
#define AL_INVALID_NAME
Definition: al.h:367
Zeni::Sound_Renderer_AL::alSourceStop_fcn
void(AL_APIENTRY * alSourceStop_fcn)(ALuint sid)
Definition: Sound_Renderer_AL.h:76
Zeni::Sound_Renderer_AL::errorString
static String errorString()
Definition: Sound_Renderer_AL.cpp:214
ALenum
int ALenum
Definition: al.h:65
Zeni::Sound_Renderer_AL::alListenerf_fcn
void(AL_APIENTRY * alListenerf_fcn)(ALenum param, ALfloat value)
Definition: Sound_Renderer_AL.h:69
alGetSourcef
AL_API void AL_APIENTRY alGetSourcef(ALuint source, ALenum param, ALfloat *value)
Definition: alSource.c:1601
Zeni::Sound_Renderer_AL::alDeleteBuffers_fcn
void(AL_APIENTRY * alDeleteBuffers_fcn)(ALsizei n, const ALuint *buffers)
Definition: Sound_Renderer_AL.h:59
Zeni::Point3f::y
float y
Definition: Coordinate.h:152
alGenBuffers
AL_API void AL_APIENTRY alGenBuffers(ALsizei n, ALuint *buffers)
Definition: alBuffer.c:183
Zeni::Sound_Renderer_AL::alcDestroyContext_fcn
void(ALC_APIENTRY * alcDestroyContext_fcn)(ALCcontext *context)
Definition: Sound_Renderer_AL.h:55
alcCreateContext
ALC_API ALCcontext *ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCint *attrList)
Definition: ALc.c:2463
Zeni::Sound_Renderer_AL::alcCreateContext_fcn
ALCcontext *(ALC_APIENTRY * alcCreateContext_fcn)(ALCdevice *device, const ALCint *attrlist)
Definition: Sound_Renderer_AL.h:54
Zeni::Vector3f::k
float k
Definition: Vector3f.h:119
Zeni::Point3f::z
float z
Definition: Coordinate.h:152
alSourcef
AL_API void AL_APIENTRY alSourcef(ALuint source, ALenum param, ALfloat value)
Definition: alSource.c:1350
Zeni::Sound_Renderer_AL::alSourceQueueBuffers_fcn
void(AL_APIENTRY * alSourceQueueBuffers_fcn)(ALuint sid, ALsizei numEntries, const ALuint *bids)
Definition: Sound_Renderer_AL.h:77
Zeni::Sound_Renderer_AL::alGetError
static alGetError_fcn alGetError()
Definition: Sound_Renderer_AL.h:91
Zeni::Vector3f::j
float j
Definition: Vector3f.h:115
alIsExtensionPresent
AL_API ALboolean AL_APIENTRY alIsExtensionPresent(const ALchar *extname)
Definition: alExtension.c:49
alSourceQueueBuffers
AL_API void AL_APIENTRY alSourceQueueBuffers(ALuint source, ALsizei nb, const ALuint *buffers)
Definition: alSource.c:2058
Zeni::Sound_Renderer_AL::set_listener_gain
void set_listener_gain(const float &gain)
Set the listener gain.
Definition: Sound_Renderer_AL.cpp:236
alGetListenerf
AL_API void AL_APIENTRY alGetListenerf(ALenum param, ALfloat *value)
Definition: alListener.c:258
AL_OUT_OF_MEMORY
#define AL_OUT_OF_MEMORY
Definition: al.h:379
Zeni::Sound_Renderer_AL::alGenSources_fcn
void(AL_APIENTRY * alGenSources_fcn)(ALsizei n, ALuint *sources)
Definition: Sound_Renderer_AL.h:68
Zeni::Sound_Renderer_AL::alDeleteSources_fcn
void(AL_APIENTRY * alDeleteSources_fcn)(ALsizei n, const ALuint *sources)
Definition: Sound_Renderer_AL.h:60
Zeni::Sound_Renderer_AL::alListenerfv
static alListenerfv_fcn alListenerfv()
Definition: Sound_Renderer_AL.h:99
AL_ORIENTATION
#define AL_ORIENTATION
Definition: al.h:228
alSourceUnqueueBuffers
AL_API void AL_APIENTRY alSourceUnqueueBuffers(ALuint source, ALsizei nb, ALuint *buffers)
Definition: alSource.c:2194
Zeni::Sound_Renderer_AL::alcCloseDevice
static alcCloseDevice_fcn alcCloseDevice()
Definition: Sound_Renderer_AL.h:82
vorbisfile.h
Zeni::Sound_Renderer_AL::alGetListenerfv_fcn
void(AL_APIENTRY * alGetListenerfv_fcn)(ALenum param, ALfloat *values)
Definition: Sound_Renderer_AL.h:64
alDeleteBuffers
AL_API void AL_APIENTRY alDeleteBuffers(ALsizei n, const ALuint *buffers)
Definition: alBuffer.c:229
handle
EGLImageKHR EGLint EGLint * handle
Definition: eglext.h:284
Zeni::Sound_Renderer_AL::alSourcefv_fcn
void(AL_APIENTRY * alSourcefv_fcn)(ALuint sid, ALenum param, const ALfloat *values)
Definition: Sound_Renderer_AL.h:72
AL_GAIN
#define AL_GAIN
Definition: al.h:196
alSourcefv
AL_API void AL_APIENTRY alSourcefv(ALuint source, ALenum param, const ALfloat *values)
Definition: alSource.c:1389
alcOpenDevice
ALC_API ALCdevice *ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName)
Definition: ALc.c:2658
alSourcei
AL_API void AL_APIENTRY alSourcei(ALuint source, ALenum param, ALint value)
Definition: alSource.c:1481
alListenerfv
AL_API void AL_APIENTRY alListenerfv(ALenum param, const ALfloat *values)
Definition: alListener.c:107
AL_INVALID_ENUM
#define AL_INVALID_ENUM
Definition: al.h:370
Zeni::Vector3f::i
float i
Definition: Vector3f.h:111
Zeni::Sound_Renderer_AL::alSourcef_fcn
void(AL_APIENTRY * alSourcef_fcn)(ALuint sid, ALenum param, ALfloat value)
Definition: Sound_Renderer_AL.h:71
zeni_audio.h
Zeni::Sound_Renderer_AL::alGetListenerf_fcn
void(AL_APIENTRY * alGetListenerf_fcn)(ALenum param, ALfloat *value)
Definition: Sound_Renderer_AL.h:63
alSourcePause
AL_API void AL_APIENTRY alSourcePause(ALuint source)
Definition: alSource.c:1949
AL_NO_ERROR
#define AL_NO_ERROR
Definition: al.h:364
AL_INVALID_OPERATION
#define AL_INVALID_OPERATION
Definition: al.h:376
Zeni::Sound_Renderer_AL::alGetSourcef_fcn
void(AL_APIENTRY * alGetSourcef_fcn)(ALuint sid, ALenum param, ALfloat *value)
Definition: Sound_Renderer_AL.h:65
AL_VELOCITY
#define AL_VELOCITY
Definition: al.h:163
Zeni::Point3f::x
float x
Definition: Coordinate.h:152
alGetListenerfv
AL_API void AL_APIENTRY alGetListenerfv(ALenum param, ALfloat *values)
Definition: alListener.c:326
alDeleteSources
AL_API void AL_APIENTRY alDeleteSources(ALsizei n, const ALuint *sources)
Definition: alSource.c:1262
Zeni::Sound_Renderer_AL::set_listener_forward_and_up
void set_listener_forward_and_up(const Vector3f &forward, const Vector3f &up)
Set the orientation of the listener.
Definition: Sound_Renderer_AL.cpp:231