mirror of
https://github.com/love2d/love-android.git
synced 2026-08-20 04:31:26 +02:00
updated to latest SDL2 (f9244b2a151)
This commit is contained in:
@@ -11,6 +11,8 @@
|
||||
*/
|
||||
#include "SDL.h"
|
||||
|
||||
#include <stdio.h> /* for fflush() and stdout */
|
||||
|
||||
static SDL_AudioSpec spec;
|
||||
static Uint8 *sound = NULL; /* Pointer to wave data */
|
||||
static Uint32 soundlen = 0; /* Length of wave data */
|
||||
@@ -48,6 +50,12 @@ test_multi_audio(int devcount)
|
||||
callback_data cbd[64];
|
||||
int keep_going = 1;
|
||||
int i;
|
||||
|
||||
#ifdef __ANDROID__
|
||||
SDL_Event event;
|
||||
|
||||
SDL_CreateWindow("testmultiaudio", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 320, 240, 0);
|
||||
#endif
|
||||
|
||||
if (devcount > 64) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Too many devices (%d), clamping to 64...\n",
|
||||
@@ -69,8 +77,12 @@ test_multi_audio(int devcount)
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Open device failed: %s\n", SDL_GetError());
|
||||
} else {
|
||||
SDL_PauseAudioDevice(cbd[0].dev, 0);
|
||||
while (!cbd[0].done)
|
||||
while (!cbd[0].done) {
|
||||
#ifdef __ANDROID__
|
||||
while (SDL_PollEvent(&event)){}
|
||||
#endif
|
||||
SDL_Delay(100);
|
||||
}
|
||||
SDL_PauseAudioDevice(cbd[0].dev, 1);
|
||||
SDL_Log("done.\n");
|
||||
SDL_CloseAudioDevice(cbd[0].dev);
|
||||
@@ -102,6 +114,9 @@ test_multi_audio(int devcount)
|
||||
keep_going = 1;
|
||||
}
|
||||
}
|
||||
#ifdef __ANDROID__
|
||||
while (SDL_PollEvent(&event)){}
|
||||
#endif
|
||||
SDL_Delay(100);
|
||||
}
|
||||
|
||||
@@ -131,7 +146,7 @@ main(int argc, char **argv)
|
||||
}
|
||||
|
||||
SDL_Log("Using audio driver: %s\n", SDL_GetCurrentAudioDriver());
|
||||
|
||||
|
||||
devcount = SDL_GetNumAudioDevices(0);
|
||||
if (devcount < 1) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Don't see any specific audio devices!\n");
|
||||
|
||||
Reference in New Issue
Block a user