aboutsummaryrefslogtreecommitdiffstats
path: root/examples/alloopback.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/alloopback.c')
-rw-r--r--examples/alloopback.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/examples/alloopback.c b/examples/alloopback.c
index 844efa74..56cd420f 100644
--- a/examples/alloopback.c
+++ b/examples/alloopback.c
@@ -30,6 +30,7 @@
#include <math.h>
#include <stdio.h>
+#define SDL_MAIN_HANDLED
#include "SDL.h"
#include "SDL_audio.h"
#include "SDL_error.h"
@@ -141,6 +142,8 @@ int main(int argc, char *argv[])
(void)argc;
(void)argv;
+ SDL_SetMainReady();
+
/* Print out error if extension is missing. */
if(!alcIsExtensionPresent(NULL, "ALC_SOFT_loopback"))
{
@@ -149,7 +152,7 @@ int main(int argc, char *argv[])
}
/* Define a macro to help load the function pointers. */
-#define LOAD_PROC(T, x) ((x) = (T)alcGetProcAddress(NULL, #x))
+#define LOAD_PROC(T, x) ((x) = FUNCTION_CAST(T, alcGetProcAddress(NULL, #x)))
LOAD_PROC(LPALCLOOPBACKOPENDEVICESOFT, alcLoopbackOpenDeviceSOFT);
LOAD_PROC(LPALCISRENDERFORMATSUPPORTEDSOFT, alcIsRenderFormatSupportedSOFT);
LOAD_PROC(LPALCRENDERSAMPLESSOFT, alcRenderSamplesSOFT);
@@ -197,6 +200,10 @@ int main(int argc, char *argv[])
attrs[3] = ALC_UNSIGNED_SHORT_SOFT;
else if(obtained.format == AUDIO_S16SYS)
attrs[3] = ALC_SHORT_SOFT;
+ else if(obtained.format == AUDIO_S32SYS)
+ attrs[3] = ALC_INT_SOFT;
+ else if(obtained.format == AUDIO_F32SYS)
+ attrs[3] = ALC_FLOAT_SOFT;
else
{
fprintf(stderr, "Unhandled SDL format: 0x%04x\n", obtained.format);