aboutsummaryrefslogtreecommitdiffstats
path: root/examples/alloopback.c
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2019-12-12 19:21:00 +0100
committerSven Gothel <[email protected]>2019-12-12 19:21:00 +0100
commit4df06c6894b39af5bf4681c0acf0c1c080084c80 (patch)
tree2505eb6e3b5798db34033c4cac2d4613bf6bda44 /examples/alloopback.c
parent8915501ed02eac2b3bce9a7fc06cb1ab562901c3 (diff)
parentc0cf323e1d56ce605e90927324d2fdafcfbb564a (diff)
merge v1.20.0
Diffstat (limited to 'examples/alloopback.c')
-rw-r--r--examples/alloopback.c17
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. */