diff --git a/templates/advance_game/advance_game.c b/templates/advance_game/advance_game.c index 5e837f876..2c6aee3a6 100644 --- a/templates/advance_game/advance_game.c +++ b/templates/advance_game/advance_game.c @@ -15,6 +15,10 @@ #include "raylib.h" #include "screens/screens.h" // NOTE: Defines global variable: currentScreen +#if defined(PLATFORM_ANDROID) + #include "android_native_app_glue.h" +#endif + //---------------------------------------------------------------------------------- // Global Variables Definition (local to this module) //---------------------------------------------------------------------------------- @@ -36,16 +40,22 @@ void DrawTransition(void); //---------------------------------------------------------------------------------- // Main entry point //---------------------------------------------------------------------------------- +#if defined(PLATFORM_ANDROID) +void android_main(struct android_app *app) +#else int main(void) +#endif { // Initialization //--------------------------------------------------------- const int screenWidth = 800; const int screenHeight = 450; - const char windowTitle[30] = ""; - - InitWindow(screenWidth, screenHeight, windowTitle); +#if defined(PLATFORM_ANDROID) + InitWindow(screenWidth, screenHeight, app); +#else + InitWindow(screenWidth, screenHeight, "raylib template - standard game"); +#endif // TODO: Load global data here (assets that must be available in all screens, i.e. fonts) // Setup and Init first screen @@ -141,8 +151,9 @@ int main(void) CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- - +#if !defined(PLATFORM_ANDROID) return 0; +#endif } void TransitionToScreen(int screen) diff --git a/templates/advance_game/resources/ambient.ogg b/templates/advance_game/resources/ambient.ogg new file mode 100644 index 000000000..af7f836ed Binary files /dev/null and b/templates/advance_game/resources/ambient.ogg differ diff --git a/templates/advance_game/resources/coin.wav b/templates/advance_game/resources/coin.wav new file mode 100644 index 000000000..6684ffc6a Binary files /dev/null and b/templates/advance_game/resources/coin.wav differ diff --git a/templates/advance_game/resources/raylib_logo.png b/templates/advance_game/resources/raylib_logo.png new file mode 100644 index 000000000..665456277 Binary files /dev/null and b/templates/advance_game/resources/raylib_logo.png differ diff --git a/templates/standard_game/standard_game.c b/templates/standard_game/standard_game.c index 36ca30f9a..f95087f78 100644 --- a/templates/standard_game/standard_game.c +++ b/templates/standard_game/standard_game.c @@ -15,18 +15,29 @@ #include "raylib.h" #include "screens/screens.h" // NOTE: Defines currentScreen +#if defined(PLATFORM_ANDROID) + #include "android_native_app_glue.h" +#endif + //---------------------------------------------------------------------------------- // Main entry point //---------------------------------------------------------------------------------- +#if defined(PLATFORM_ANDROID) +void android_main(struct android_app *app) +#else int main(void) +#endif { // Initialization //--------------------------------------------------------- const int screenWidth = 800; const int screenHeight = 450; - const char windowTitle[30] = ""; - - InitWindow(screenWidth, screenHeight, windowTitle); + +#if defined(PLATFORM_ANDROID) + InitWindow(screenWidth, screenHeight, app); +#else + InitWindow(screenWidth, screenHeight, "raylib template - standard game"); +#endif // TODO: Load global data here (assets that must be available in all screens, i.e. fonts) @@ -139,6 +150,7 @@ int main(void) CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- - +#if !defined(PLATFORM_ANDROID) return 0; +#endif } \ No newline at end of file