diff options
| author | Ray <[email protected]> | 2017-10-22 11:12:10 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2017-10-22 11:12:10 +0200 |
| commit | 3f9d76f227f166d339b1c4b5dd507e2491e9b967 (patch) | |
| tree | f055a8ae252ec7b08028d8cf5d65eaacc8e88206 /games/missile_commander.c | |
| parent | 33da9bc8f609d904da48161d98e5df527a86ff60 (diff) | |
| download | raylib-3f9d76f227f166d339b1c4b5dd507e2491e9b967.tar.gz raylib-3f9d76f227f166d339b1c4b5dd507e2491e9b967.zip | |
Updated Makefile to support Android
Diffstat (limited to 'games/missile_commander.c')
| -rw-r--r-- | games/missile_commander.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/games/missile_commander.c b/games/missile_commander.c index 6317c41a..245cefd1 100644 --- a/games/missile_commander.c +++ b/games/missile_commander.c @@ -18,6 +18,10 @@ #include <time.h> #include <math.h> +#if defined(PLATFORM_ANDROID) + #include "android_native_app_glue.h" +#endif + #if defined(PLATFORM_WEB) #include <emscripten/emscripten.h> #endif @@ -115,11 +119,19 @@ static void UpdateIncomingFire(); //------------------------------------------------------------------------------------ // Program main entry 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, "sample game: missile commander"); +#endif InitGame(); @@ -133,14 +145,9 @@ int main() // Main game loop while (!WindowShouldClose()) // Detect window close button or ESC key { - // Update - //---------------------------------------------------------------------------------- - UpdateGame(); - //---------------------------------------------------------------------------------- - - // Draw + // Update and Draw //---------------------------------------------------------------------------------- - DrawGame(); + UpdateDrawFrame(); //---------------------------------------------------------------------------------- } #endif @@ -151,8 +158,9 @@ int main() CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- - +#if !defined(PLATFORM_ANDROID) return 0; +#endif } //-------------------------------------------------------------------------------------- |
