summaryrefslogtreecommitdiffhomepage
path: root/examples/web/core/core_2d_camera.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/web/core/core_2d_camera.c')
-rw-r--r--examples/web/core/core_2d_camera.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/examples/web/core/core_2d_camera.c b/examples/web/core/core_2d_camera.c
index 1f08ee2..1884899 100644
--- a/examples/web/core/core_2d_camera.c
+++ b/examples/web/core/core_2d_camera.c
@@ -15,6 +15,10 @@
#include <emscripten/emscripten.h>
#endif
+#if defined(PLATFORM_ANDROID)
+ #include "android_native_app_glue.h"
+#endif
+
#define MAX_BUILDINGS 100
//----------------------------------------------------------------------------------
@@ -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 [core] example - 2d camera");
-
+#endif
+
int spacing = 0;
for (int i = 0; i < MAX_BUILDINGS; i++)
@@ -79,8 +91,9 @@ int main()
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
-
+#if !defined(PLATFORM_ANDROID)
return 0;
+#endif
}
//----------------------------------------------------------------------------------