aboutsummaryrefslogtreecommitdiffstats
path: root/examples/allatency.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/allatency.c')
-rw-r--r--examples/allatency.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/examples/allatency.c b/examples/allatency.c
index d561373f..a61fb820 100644
--- a/examples/allatency.c
+++ b/examples/allatency.c
@@ -27,10 +27,11 @@
#include <stdio.h>
#include <assert.h>
-#include <SDL_sound.h>
+#include "SDL_sound.h"
+#include "SDL_audio.h"
+#include "SDL_stdinc.h"
#include "AL/al.h"
-#include "AL/alc.h"
#include "AL/alext.h"
#include "common/alhelpers.h"
@@ -114,7 +115,7 @@ static ALuint LoadSound(const char *filename)
* close the file. */
buffer = 0;
alGenBuffers(1, &buffer);
- alBufferData(buffer, format, sample->buffer, slen, sample->actual.rate);
+ alBufferData(buffer, format, sample->buffer, (ALsizei)slen, (ALsizei)sample->actual.rate);
Sound_FreeSample(sample);
/* Check if an error occured, and clean up if so. */
@@ -157,19 +158,19 @@ int main(int argc, char **argv)
}
/* Define a macro to help load the function pointers. */
-#define LOAD_PROC(x) ((x) = alGetProcAddress(#x))
- LOAD_PROC(alSourcedSOFT);
- LOAD_PROC(alSource3dSOFT);
- LOAD_PROC(alSourcedvSOFT);
- LOAD_PROC(alGetSourcedSOFT);
- LOAD_PROC(alGetSource3dSOFT);
- LOAD_PROC(alGetSourcedvSOFT);
- LOAD_PROC(alSourcei64SOFT);
- LOAD_PROC(alSource3i64SOFT);
- LOAD_PROC(alSourcei64vSOFT);
- LOAD_PROC(alGetSourcei64SOFT);
- LOAD_PROC(alGetSource3i64SOFT);
- LOAD_PROC(alGetSourcei64vSOFT);
+#define LOAD_PROC(T, x) ((x) = (T)alGetProcAddress(#x))
+ LOAD_PROC(LPALSOURCEDSOFT, alSourcedSOFT);
+ LOAD_PROC(LPALSOURCE3DSOFT, alSource3dSOFT);
+ LOAD_PROC(LPALSOURCEDVSOFT, alSourcedvSOFT);
+ LOAD_PROC(LPALGETSOURCEDSOFT, alGetSourcedSOFT);
+ LOAD_PROC(LPALGETSOURCE3DSOFT, alGetSource3dSOFT);
+ LOAD_PROC(LPALGETSOURCEDVSOFT, alGetSourcedvSOFT);
+ LOAD_PROC(LPALSOURCEI64SOFT, alSourcei64SOFT);
+ LOAD_PROC(LPALSOURCE3I64SOFT, alSource3i64SOFT);
+ LOAD_PROC(LPALSOURCEI64VSOFT, alSourcei64vSOFT);
+ LOAD_PROC(LPALGETSOURCEI64SOFT, alGetSourcei64SOFT);
+ LOAD_PROC(LPALGETSOURCE3I64SOFT, alGetSource3i64SOFT);
+ LOAD_PROC(LPALGETSOURCEI64VSOFT, alGetSourcei64vSOFT);
#undef LOAD_PROC
/* Initialize SDL_sound. */
@@ -187,7 +188,7 @@ int main(int argc, char **argv)
/* Create the source to play the sound with. */
source = 0;
alGenSources(1, &source);
- alSourcei(source, AL_BUFFER, buffer);
+ alSourcei(source, AL_BUFFER, (ALint)buffer);
assert(alGetError()==AL_NO_ERROR && "Failed to setup sound source");
/* Play the sound until it finishes. */