summaryrefslogtreecommitdiffhomepage
path: root/examples/web/textures/textures_image_loading.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/web/textures/textures_image_loading.c')
-rw-r--r--examples/web/textures/textures_image_loading.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/examples/web/textures/textures_image_loading.c b/examples/web/textures/textures_image_loading.c
index 6455221..17680a0 100644
--- a/examples/web/textures/textures_image_loading.c
+++ b/examples/web/textures/textures_image_loading.c
@@ -17,6 +17,10 @@
#include <emscripten/emscripten.h>
#endif
+#if defined(PLATFORM_ANDROID)
+ #include "android_native_app_glue.h"
+#endif
+
//----------------------------------------------------------------------------------
// Global Variables Definition
//----------------------------------------------------------------------------------
@@ -34,12 +38,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 [textures] example - image loading");
-
+#endif
+
Image image = LoadImage("resources/raylib_logo.png"); // Loaded in CPU memory (RAM)
texture = LoadTextureFromImage(image); // Image converted to texture, GPU memory (VRAM)
UnloadImage(image); // Once image has been converted to texture and uploaded to VRAM, it can be unloaded from RAM
@@ -64,8 +76,9 @@ int main()
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
-
+#if !defined(PLATFORM_ANDROID)
return 0;
+#endif
}
//----------------------------------------------------------------------------------