summaryrefslogtreecommitdiffhomepage
path: root/games/gorilas.c
diff options
context:
space:
mode:
Diffstat (limited to 'games/gorilas.c')
-rw-r--r--games/gorilas.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/games/gorilas.c b/games/gorilas.c
index 86fd3f5b..75decd96 100644
--- a/games/gorilas.c
+++ b/games/gorilas.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
@@ -116,11 +120,19 @@ static bool UpdateBall(int playerTurn);
//------------------------------------------------------------------------------------
// 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: gorilas");
+#endif
InitGame();
@@ -134,14 +146,9 @@ int main()
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
- // Update
- //----------------------------------------------------------------------------------
- UpdateGame();
- //----------------------------------------------------------------------------------
-
- // Draw
+ // Update and Draw
//----------------------------------------------------------------------------------
- DrawGame();
+ UpdateDrawFrame();
//----------------------------------------------------------------------------------
}
#endif
@@ -152,8 +159,9 @@ int main()
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
-
+#if !defined(PLATFORM_ANDROID)
return 0;
+#endif
}
//------------------------------------------------------------------------------------