diff options
Diffstat (limited to 'examples/web/audio/audio_music_stream.c')
| -rw-r--r-- | examples/web/audio/audio_music_stream.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/examples/web/audio/audio_music_stream.c b/examples/web/audio/audio_music_stream.c index da5ac83..e56fc30 100644 --- a/examples/web/audio/audio_music_stream.c +++ b/examples/web/audio/audio_music_stream.c @@ -17,6 +17,10 @@ #include <emscripten/emscripten.h> #endif +#if defined(PLATFORM_ANDROID) + #include "android_native_app_glue.h" +#endif + //---------------------------------------------------------------------------------- // Global Variables Definition //---------------------------------------------------------------------------------- @@ -37,12 +41,20 @@ void UpdateDrawFrame(void); // Update and Draw one frame //---------------------------------------------------------------------------------- // Main Enry Point //---------------------------------------------------------------------------------- -int main() +#if defined(PLATFORM_ANDROID) +void android_main(struct android_app *app) +#else +int main(void) +#endif { // Initialization //-------------------------------------------------------------------------------------- +#if defined(PLATFORM_ANDROID) + InitWindow(screenWidth, screenHeight, app); +#else InitWindow(screenWidth, screenHeight, "raylib [audio] example - music playing (streaming)"); - +#endif + InitAudioDevice(); // Initialize audio device music = LoadMusicStream("resources/guitar_noodling.ogg"); @@ -69,8 +81,9 @@ int main() CloseAudioDevice(); // Close audio device (music streaming is automatically stopped) CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- - +#if !defined(PLATFORM_ANDROID) return 0; +#endif } //---------------------------------------------------------------------------------- |
