Quake II RTX doxygen  1.0 dev
fixed.h File Reference
#include <AL/al.h>

Go to the source code of this file.

Macros

#define AL_LOOP_POINTS_SOFT   0x2015
 
#define qalEnable   alEnable
 
#define qalDisable   alDisable
 
#define qalIsEnabled   alIsEnabled
 
#define qalGetString   alGetString
 
#define qalGetBooleanv   alGetBooleanv
 
#define qalGetIntegerv   alGetIntegerv
 
#define qalGetFloatv   alGetFloatv
 
#define qalGetDoublev   alGetDoublev
 
#define qalGetBoolean   alGetBoolean
 
#define qalGetInteger   alGetInteger
 
#define qalGetFloat   alGetFloat
 
#define qalGetDouble   alGetDouble
 
#define qalGetError   alGetError
 
#define qalIsExtensionPresent   alIsExtensionPresent
 
#define qalGetProcAddress   alGetProcAddress
 
#define qalGetEnumValue   alGetEnumValue
 
#define qalListenerf   alListenerf
 
#define qalListener3f   alListener3f
 
#define qalListenerfv   alListenerfv
 
#define qalListeneri   alListeneri
 
#define qalListener3i   alListener3i
 
#define qalListeneriv   alListeneriv
 
#define qalGetListenerf   alGetListenerf
 
#define qalGetListener3f   alGetListener3f
 
#define qalGetListenerfv   alGetListenerfv
 
#define qalGetListeneri   alGetListeneri
 
#define qalGetListener3i   alGetListener3i
 
#define qalGetListeneriv   alGetListeneriv
 
#define qalGenSources   alGenSources
 
#define qalDeleteSources   alDeleteSources
 
#define qalIsSource   alIsSource
 
#define qalSourcef   alSourcef
 
#define qalSource3f   alSource3f
 
#define qalSourcefv   alSourcefv
 
#define qalSourcei   alSourcei
 
#define qalSource3i   alSource3i
 
#define qalSourceiv   alSourceiv
 
#define qalGetSourcef   alGetSourcef
 
#define qalGetSource3f   alGetSource3f
 
#define qalGetSourcefv   alGetSourcefv
 
#define qalGetSourcei   alGetSourcei
 
#define qalGetSource3i   alGetSource3i
 
#define qalGetSourceiv   alGetSourceiv
 
#define qalSourcePlayv   alSourcePlayv
 
#define qalSourceStopv   alSourceStopv
 
#define qalSourceRewindv   alSourceRewindv
 
#define qalSourcePausev   alSourcePausev
 
#define qalSourcePlay   alSourcePlay
 
#define qalSourceStop   alSourceStop
 
#define qalSourceRewind   alSourceRewind
 
#define qalSourcePause   alSourcePause
 
#define qalSourceQueueBuffers   alSourceQueueBuffers
 
#define qalSourceUnqueueBuffers   alSourceUnqueueBuffers
 
#define qalGenBuffers   alGenBuffers
 
#define qalDeleteBuffers   alDeleteBuffers
 
#define qalIsBuffer   alIsBuffer
 
#define qalBufferData   alBufferData
 
#define qalBufferf   alBufferf
 
#define qalBuffer3f   alBuffer3f
 
#define qalBufferfv   alBufferfv
 
#define qalBufferi   alBufferi
 
#define qalBuffer3i   alBuffer3i
 
#define qalBufferiv   alBufferiv
 
#define qalGetBufferf   alGetBufferf
 
#define qalGetBuffer3f   alGetBuffer3f
 
#define qalGetBufferfv   alGetBufferfv
 
#define qalGetBufferi   alGetBufferi
 
#define qalGetBuffer3i   alGetBuffer3i
 
#define qalGetBufferiv   alGetBufferiv
 
#define qalDopplerFactor   alDopplerFactor
 
#define qalDopplerVelocity   alDopplerVelocity
 
#define qalSpeedOfSound   alSpeedOfSound
 
#define qalDistanceModel   alDistanceModel
 

Functions

qboolean QAL_Init (void)
 
void QAL_Shutdown (void)
 

Macro Definition Documentation

◆ AL_LOOP_POINTS_SOFT

#define AL_LOOP_POINTS_SOFT   0x2015

Definition at line 23 of file fixed.h.

◆ qalBuffer3f

#define qalBuffer3f   alBuffer3f

Definition at line 84 of file fixed.h.

◆ qalBuffer3i

#define qalBuffer3i   alBuffer3i

Definition at line 87 of file fixed.h.

◆ qalBufferData

#define qalBufferData   alBufferData

Definition at line 82 of file fixed.h.

◆ qalBufferf

#define qalBufferf   alBufferf

Definition at line 83 of file fixed.h.

◆ qalBufferfv

#define qalBufferfv   alBufferfv

Definition at line 85 of file fixed.h.

◆ qalBufferi

#define qalBufferi   alBufferi

Definition at line 86 of file fixed.h.

◆ qalBufferiv

#define qalBufferiv   alBufferiv

Definition at line 88 of file fixed.h.

◆ qalDeleteBuffers

#define qalDeleteBuffers   alDeleteBuffers

Definition at line 80 of file fixed.h.

◆ qalDeleteSources

#define qalDeleteSources   alDeleteSources

Definition at line 55 of file fixed.h.

◆ qalDisable

#define qalDisable   alDisable

Definition at line 27 of file fixed.h.

◆ qalDistanceModel

#define qalDistanceModel   alDistanceModel

Definition at line 98 of file fixed.h.

◆ qalDopplerFactor

#define qalDopplerFactor   alDopplerFactor

Definition at line 95 of file fixed.h.

◆ qalDopplerVelocity

#define qalDopplerVelocity   alDopplerVelocity

Definition at line 96 of file fixed.h.

◆ qalEnable

#define qalEnable   alEnable

Definition at line 26 of file fixed.h.

◆ qalGenBuffers

#define qalGenBuffers   alGenBuffers

Definition at line 79 of file fixed.h.

◆ qalGenSources

#define qalGenSources   alGenSources

Definition at line 54 of file fixed.h.

◆ qalGetBoolean

#define qalGetBoolean   alGetBoolean

Definition at line 34 of file fixed.h.

◆ qalGetBooleanv

#define qalGetBooleanv   alGetBooleanv

Definition at line 30 of file fixed.h.

◆ qalGetBuffer3f

#define qalGetBuffer3f   alGetBuffer3f

Definition at line 90 of file fixed.h.

◆ qalGetBuffer3i

#define qalGetBuffer3i   alGetBuffer3i

Definition at line 93 of file fixed.h.

◆ qalGetBufferf

#define qalGetBufferf   alGetBufferf

Definition at line 89 of file fixed.h.

◆ qalGetBufferfv

#define qalGetBufferfv   alGetBufferfv

Definition at line 91 of file fixed.h.

◆ qalGetBufferi

#define qalGetBufferi   alGetBufferi

Definition at line 92 of file fixed.h.

◆ qalGetBufferiv

#define qalGetBufferiv   alGetBufferiv

Definition at line 94 of file fixed.h.

◆ qalGetDouble

#define qalGetDouble   alGetDouble

Definition at line 37 of file fixed.h.

◆ qalGetDoublev

#define qalGetDoublev   alGetDoublev

Definition at line 33 of file fixed.h.

◆ qalGetEnumValue

#define qalGetEnumValue   alGetEnumValue

Definition at line 41 of file fixed.h.

◆ qalGetError

#define qalGetError   alGetError

Definition at line 38 of file fixed.h.

◆ qalGetFloat

#define qalGetFloat   alGetFloat

Definition at line 36 of file fixed.h.

◆ qalGetFloatv

#define qalGetFloatv   alGetFloatv

Definition at line 32 of file fixed.h.

◆ qalGetInteger

#define qalGetInteger   alGetInteger

Definition at line 35 of file fixed.h.

◆ qalGetIntegerv

#define qalGetIntegerv   alGetIntegerv

Definition at line 31 of file fixed.h.

◆ qalGetListener3f

#define qalGetListener3f   alGetListener3f

Definition at line 49 of file fixed.h.

◆ qalGetListener3i

#define qalGetListener3i   alGetListener3i

Definition at line 52 of file fixed.h.

◆ qalGetListenerf

#define qalGetListenerf   alGetListenerf

Definition at line 48 of file fixed.h.

◆ qalGetListenerfv

#define qalGetListenerfv   alGetListenerfv

Definition at line 50 of file fixed.h.

◆ qalGetListeneri

#define qalGetListeneri   alGetListeneri

Definition at line 51 of file fixed.h.

◆ qalGetListeneriv

#define qalGetListeneriv   alGetListeneriv

Definition at line 53 of file fixed.h.

◆ qalGetProcAddress

#define qalGetProcAddress   alGetProcAddress

Definition at line 40 of file fixed.h.

◆ qalGetSource3f

#define qalGetSource3f   alGetSource3f

Definition at line 64 of file fixed.h.

◆ qalGetSource3i

#define qalGetSource3i   alGetSource3i

Definition at line 67 of file fixed.h.

◆ qalGetSourcef

#define qalGetSourcef   alGetSourcef

Definition at line 63 of file fixed.h.

◆ qalGetSourcefv

#define qalGetSourcefv   alGetSourcefv

Definition at line 65 of file fixed.h.

◆ qalGetSourcei

#define qalGetSourcei   alGetSourcei

Definition at line 66 of file fixed.h.

◆ qalGetSourceiv

#define qalGetSourceiv   alGetSourceiv

Definition at line 68 of file fixed.h.

◆ qalGetString

#define qalGetString   alGetString

Definition at line 29 of file fixed.h.

◆ qalIsBuffer

#define qalIsBuffer   alIsBuffer

Definition at line 81 of file fixed.h.

◆ qalIsEnabled

#define qalIsEnabled   alIsEnabled

Definition at line 28 of file fixed.h.

◆ qalIsExtensionPresent

#define qalIsExtensionPresent   alIsExtensionPresent

Definition at line 39 of file fixed.h.

◆ qalIsSource

#define qalIsSource   alIsSource

Definition at line 56 of file fixed.h.

◆ qalListener3f

#define qalListener3f   alListener3f

Definition at line 43 of file fixed.h.

◆ qalListener3i

#define qalListener3i   alListener3i

Definition at line 46 of file fixed.h.

◆ qalListenerf

#define qalListenerf   alListenerf

Definition at line 42 of file fixed.h.

◆ qalListenerfv

#define qalListenerfv   alListenerfv

Definition at line 44 of file fixed.h.

◆ qalListeneri

#define qalListeneri   alListeneri

Definition at line 45 of file fixed.h.

◆ qalListeneriv

#define qalListeneriv   alListeneriv

Definition at line 47 of file fixed.h.

◆ qalSource3f

#define qalSource3f   alSource3f

Definition at line 58 of file fixed.h.

◆ qalSource3i

#define qalSource3i   alSource3i

Definition at line 61 of file fixed.h.

◆ qalSourcef

#define qalSourcef   alSourcef

Definition at line 57 of file fixed.h.

◆ qalSourcefv

#define qalSourcefv   alSourcefv

Definition at line 59 of file fixed.h.

◆ qalSourcei

#define qalSourcei   alSourcei

Definition at line 60 of file fixed.h.

◆ qalSourceiv

#define qalSourceiv   alSourceiv

Definition at line 62 of file fixed.h.

◆ qalSourcePause

#define qalSourcePause   alSourcePause

Definition at line 76 of file fixed.h.

◆ qalSourcePausev

#define qalSourcePausev   alSourcePausev

Definition at line 72 of file fixed.h.

◆ qalSourcePlay

#define qalSourcePlay   alSourcePlay

Definition at line 73 of file fixed.h.

◆ qalSourcePlayv

#define qalSourcePlayv   alSourcePlayv

Definition at line 69 of file fixed.h.

◆ qalSourceQueueBuffers

#define qalSourceQueueBuffers   alSourceQueueBuffers

Definition at line 77 of file fixed.h.

◆ qalSourceRewind

#define qalSourceRewind   alSourceRewind

Definition at line 75 of file fixed.h.

◆ qalSourceRewindv

#define qalSourceRewindv   alSourceRewindv

Definition at line 71 of file fixed.h.

◆ qalSourceStop

#define qalSourceStop   alSourceStop

Definition at line 74 of file fixed.h.

◆ qalSourceStopv

#define qalSourceStopv   alSourceStopv

Definition at line 70 of file fixed.h.

◆ qalSourceUnqueueBuffers

#define qalSourceUnqueueBuffers   alSourceUnqueueBuffers

Definition at line 78 of file fixed.h.

◆ qalSpeedOfSound

#define qalSpeedOfSound   alSpeedOfSound

Definition at line 97 of file fixed.h.

Function Documentation

◆ QAL_Init()

qboolean QAL_Init ( void  )

Definition at line 92 of file dynamic.c.

93 {
94  al_driver = Cvar_Get("al_driver", LIBAL, 0);
95  al_device = Cvar_Get("al_device", "", 0);
96 
97  // don't allow absolute or relative paths
99 
100  Sys_LoadLibrary(al_driver->string, NULL, &handle);
101  if (!handle) {
102  return qfalse;
103  }
104 
105 #define QAL(type, func) if ((q##func = Sys_GetProcAddress(handle, #func)) == NULL) goto fail;
106  QALC_IMP
107  QAL_IMP
108 #undef QAL
109 
110  device = qalcOpenDevice(al_device->string[0] ? al_device->string : NULL);
111  if (!device) {
112  Com_SetLastError(va("alcOpenDevice(%s) failed", al_device->string));
113  goto fail;
114  }
115 
116  context = qalcCreateContext(device, NULL);
117  if (!context) {
118  Com_SetLastError("alcCreateContext failed");
119  goto fail;
120  }
121 
122  if (!qalcMakeContextCurrent(context)) {
123  Com_SetLastError("alcMakeContextCurrent failed");
124  goto fail;
125  }
126 
127  al_driver->flags |= CVAR_SOUND;
128  al_device->flags |= CVAR_SOUND;
129 
130  return qtrue;
131 
132 fail:
133  QAL_Shutdown();
134  return qfalse;
135 }

Referenced by AL_Init().

◆ QAL_Shutdown()

void QAL_Shutdown ( void  )

Definition at line 64 of file dynamic.c.

65 {
66  if (context) {
67  qalcMakeContextCurrent(NULL);
68  qalcDestroyContext(context);
69  context = NULL;
70  }
71  if (device) {
72  qalcCloseDevice(device);
73  device = NULL;
74  }
75 
76 #define QAL(type, func) q##func = NULL
77  QALC_IMP
78  QAL_IMP
79 #undef QAL
80 
81  if (handle) {
83  handle = NULL;
84  }
85 
86  if (al_driver)
87  al_driver->flags &= ~CVAR_SOUND;
88  if (al_device)
89  al_device->flags &= ~CVAR_SOUND;
90 }

Referenced by AL_Init(), AL_Shutdown(), and QAL_Init().

handle
static void * handle
Definition: dynamic.c:52
al_device
static cvar_t * al_device
Definition: dynamic.c:50
QAL_IMP
#define QAL_IMP
Definition: dynamic.h:27
QAL_Shutdown
QAL_IMP void QAL_Shutdown(void)
Definition: dynamic.c:64
Cvar_Get
cvar_t * Cvar_Get(const char *var_name, const char *var_value, int flags)
Definition: cvar.c:257
device
static ALCdevice * device
Definition: dynamic.c:53
QALC_IMP
#define QALC_IMP
Definition: dynamic.c:27
al_driver
static cvar_t * al_driver
Definition: dynamic.c:49
va
char * va(const char *format,...)
Definition: shared.c:429
Sys_LoadLibrary
void * Sys_LoadLibrary(const char *path, const char *sym, void **handle)
Definition: system.c:794
FS_SanitizeFilenameVariable
void FS_SanitizeFilenameVariable(cvar_t *var)
Definition: files.c:294
context
static ALCcontext * context
Definition: dynamic.c:54
Com_SetLastError
void Com_SetLastError(const char *msg)
Definition: common.c:382
Sys_FreeLibrary
void Sys_FreeLibrary(void *handle)
Definition: system.c:787