diff options
Diffstat (limited to 'examples/alloopback.c')
-rw-r--r-- | examples/alloopback.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/examples/alloopback.c b/examples/alloopback.c index 16553f9b..844efa74 100644 --- a/examples/alloopback.c +++ b/examples/alloopback.c @@ -26,11 +26,14 @@ * output handling. */ -#include <stdio.h> #include <assert.h> #include <math.h> +#include <stdio.h> -#include <SDL.h> +#include "SDL.h" +#include "SDL_audio.h" +#include "SDL_error.h" +#include "SDL_stdinc.h" #include "AL/al.h" #include "AL/alc.h" @@ -146,10 +149,10 @@ int main(int argc, char *argv[]) } /* Define a macro to help load the function pointers. */ -#define LOAD_PROC(x) ((x) = alcGetProcAddress(NULL, #x)) - LOAD_PROC(alcLoopbackOpenDeviceSOFT); - LOAD_PROC(alcIsRenderFormatSupportedSOFT); - LOAD_PROC(alcRenderSamplesSOFT); +#define LOAD_PROC(T, x) ((x) = (T)alcGetProcAddress(NULL, #x)) + LOAD_PROC(LPALCLOOPBACKOPENDEVICESOFT, alcLoopbackOpenDeviceSOFT); + LOAD_PROC(LPALCISRENDERFORMATSUPPORTEDSOFT, alcIsRenderFormatSupportedSOFT); + LOAD_PROC(LPALCRENDERSAMPLESSOFT, alcRenderSamplesSOFT); #undef LOAD_PROC if(SDL_Init(SDL_INIT_AUDIO) == -1) @@ -246,7 +249,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. */ |