zenilib  0.5.3.0
 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 
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 
217  else
218  return "OpenAL not initialized";
219  }
220 
222  ALfloat listener_position[3] = {position.x, position.y, position.z};
223  alListenerfv()(AL_POSITION, listener_position);
224  }
225 
227  ALfloat listener_velocity[3] = {velocity.i, velocity.j, velocity.k};
228  alListenerfv()(AL_VELOCITY, listener_velocity);
229  }
230 
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};
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
AL_API void AL_APIENTRY alSourcePlay(ALuint source)
Definition: alSource.c:1894
void set_listener_position(const Point3f &position)
Set the position of the listener and BGM.
void(AL_APIENTRY * alBufferData_fcn)(ALuint bid, ALenum format, const ALvoid *data, ALsizei size, ALsizei freq)
void(AL_APIENTRY * alSourcePause_fcn)(ALuint sid)
static alListenerf_fcn alListenerf()
void(AL_APIENTRY * alSourceUnqueueBuffers_fcn)(ALuint sid, ALsizei numEntries, ALuint *bids)
AL_API void AL_APIENTRY alBufferData(ALuint buffer, ALenum format, const ALvoid *data, ALsizei size, ALsizei freq)
Definition: alBuffer.c:289
static alcDestroyContext_fcn alcDestroyContext()
ALboolean(AL_APIENTRY * alIsExtensionPresent_fcn)(const ALchar *extname)
ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent(ALCcontext *context)
Definition: ALc.c:2590
ALC_API ALCboolean ALC_APIENTRY alcCloseDevice(ALCdevice *Device)
Definition: ALc.c:2884
#define AL_INVALID_VALUE
Definition: al.h:373
void(AL_APIENTRY * alListenerfv_fcn)(ALenum param, const ALfloat *values)
AL_API ALenum AL_APIENTRY alGetError(void)
Definition: alError.c:46
ALCdevice *(ALC_APIENTRY * alcOpenDevice_fcn)(const ALCchar *devicename)
AL_API void AL_APIENTRY alGetSourcei(ALuint source, ALenum param, ALint *value)
Definition: alSource.c:1754
ALC_API ALCvoid ALC_APIENTRY alcDestroyContext(ALCcontext *context)
Definition: ALc.c:2539
FILE * file
Definition: visualinfo.c:88
ALCboolean(ALC_APIENTRY * alcMakeContextCurrent_fcn)(ALCcontext *context)
EGLImageKHR EGLint * name
Definition: eglext.h:284
static alGetListenerfv_fcn alGetListenerfv()
ALenum(AL_APIENTRY * alGetError_fcn)(void)
void(AL_APIENTRY * alSourcei_fcn)(ALuint sid, ALenum param, ALint value)
float ALfloat
Definition: al.h:68
AL_API void AL_APIENTRY alGenSources(ALsizei n, ALuint *sources)
Definition: alSource.c:1216
#define AL_POSITION
Definition: al.h:144
std::pair< Vector3f, Vector3f > get_listener_forward_and_up() const
Set the orientation of the listener.
void(AL_APIENTRY * alGetSourcefv_fcn)(ALuint sid, ALenum param, ALfloat *values)
AL_API void AL_APIENTRY alListenerf(ALenum param, ALfloat value)
Definition: alListener.c:29
void(AL_APIENTRY * alGenBuffers_fcn)(ALsizei n, ALuint *buffers)
A 3D Point represented with floats.
Definition: Coordinate.h:133
ALCboolean(ALC_APIENTRY * alcCloseDevice_fcn)(ALCdevice *device)
void set_listener_velocity(const Vector3f &velocity)
Set the velocity of the listener and BGM for the doppler effect.
AL_API void AL_APIENTRY alSourceStop(ALuint source)
Definition: alSource.c:1985
A Featureful 3-Space Vector Class.
Definition: Vector3f.h:58
void(AL_APIENTRY * alGetSourcei_fcn)(ALuint sid, ALenum param, ALint *value)
void(AL_APIENTRY * alSourcePlay_fcn)(ALuint sid)
AL_API void AL_APIENTRY alGetSourcefv(ALuint source, ALenum param, ALfloat *values)
Definition: alSource.c:1655
#define AL_INVALID_NAME
Definition: al.h:367
void(AL_APIENTRY * alSourceStop_fcn)(ALuint sid)
int ALenum
Definition: al.h:65
void(AL_APIENTRY * alListenerf_fcn)(ALenum param, ALfloat value)
AL_API void AL_APIENTRY alGetSourcef(ALuint source, ALenum param, ALfloat *value)
Definition: alSource.c:1601
void(AL_APIENTRY * alDeleteBuffers_fcn)(ALsizei n, const ALuint *buffers)
AL_API void AL_APIENTRY alGenBuffers(ALsizei n, ALuint *buffers)
Definition: alBuffer.c:183
void(ALC_APIENTRY * alcDestroyContext_fcn)(ALCcontext *context)
ALC_API ALCcontext *ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCint *attrList)
Definition: ALc.c:2463
ALCcontext *(ALC_APIENTRY * alcCreateContext_fcn)(ALCdevice *device, const ALCint *attrlist)
AL_API void AL_APIENTRY alSourcef(ALuint source, ALenum param, ALfloat value)
Definition: alSource.c:1350
void(AL_APIENTRY * alSourceQueueBuffers_fcn)(ALuint sid, ALsizei numEntries, const ALuint *bids)
static alGetError_fcn alGetError()
AL_API ALboolean AL_APIENTRY alIsExtensionPresent(const ALchar *extname)
Definition: alExtension.c:49
AL_API void AL_APIENTRY alSourceQueueBuffers(ALuint source, ALsizei nb, const ALuint *buffers)
Definition: alSource.c:2058
void set_listener_gain(const float &gain)
Set the listener gain.
AL_API void AL_APIENTRY alGetListenerf(ALenum param, ALfloat *value)
Definition: alListener.c:258
#define AL_OUT_OF_MEMORY
Definition: al.h:379
void(AL_APIENTRY * alGenSources_fcn)(ALsizei n, ALuint *sources)
void(AL_APIENTRY * alDeleteSources_fcn)(ALsizei n, const ALuint *sources)
static alListenerfv_fcn alListenerfv()
#define AL_ORIENTATION
Definition: al.h:228
AL_API void AL_APIENTRY alSourceUnqueueBuffers(ALuint source, ALsizei nb, ALuint *buffers)
Definition: alSource.c:2194
static alcCloseDevice_fcn alcCloseDevice()
void(AL_APIENTRY * alGetListenerfv_fcn)(ALenum param, ALfloat *values)
AL_API void AL_APIENTRY alDeleteBuffers(ALsizei n, const ALuint *buffers)
Definition: alBuffer.c:229
EGLImageKHR EGLint EGLint * handle
Definition: eglext.h:284
void(AL_APIENTRY * alSourcefv_fcn)(ALuint sid, ALenum param, const ALfloat *values)
#define AL_GAIN
Definition: al.h:196
AL_API void AL_APIENTRY alSourcefv(ALuint source, ALenum param, const ALfloat *values)
Definition: alSource.c:1389
ALC_API ALCdevice *ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName)
Definition: ALc.c:2658
AL_API void AL_APIENTRY alSourcei(ALuint source, ALenum param, ALint value)
Definition: alSource.c:1481
AL_API void AL_APIENTRY alListenerfv(ALenum param, const ALfloat *values)
Definition: alListener.c:107
#define AL_INVALID_ENUM
Definition: al.h:370
void(AL_APIENTRY * alSourcef_fcn)(ALuint sid, ALenum param, ALfloat value)
void(AL_APIENTRY * alGetListenerf_fcn)(ALenum param, ALfloat *value)
AL_API void AL_APIENTRY alSourcePause(ALuint source)
Definition: alSource.c:1949
#define AL_NO_ERROR
Definition: al.h:364
#define AL_INVALID_OPERATION
Definition: al.h:376
void(AL_APIENTRY * alGetSourcef_fcn)(ALuint sid, ALenum param, ALfloat *value)
#define AL_VELOCITY
Definition: al.h:163
AL_API void AL_APIENTRY alGetListenerfv(ALenum param, ALfloat *values)
Definition: alListener.c:326
AL_API void AL_APIENTRY alDeleteSources(ALsizei n, const ALuint *sources)
Definition: alSource.c:1262
void set_listener_forward_and_up(const Vector3f &forward, const Vector3f &up)
Set the orientation of the listener.