From d918334a2e1ce32961c0797a4b13fdd5b4ce5630 Mon Sep 17 00:00:00 2001 From: Ray San Date: Fri, 3 Nov 2017 20:01:48 +0100 Subject: Updated to support Android platform --- examples/web/textures/textures_image_generation.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'examples/web/textures/textures_image_generation.c') diff --git a/examples/web/textures/textures_image_generation.c b/examples/web/textures/textures_image_generation.c index 9932ab6..e5dba4a 100644 --- a/examples/web/textures/textures_image_generation.c +++ b/examples/web/textures/textures_image_generation.c @@ -15,6 +15,10 @@ #include #endif +#if defined(PLATFORM_ANDROID) + #include "android_native_app_glue.h" +#endif + #define NUM_TEXTURES 7 // Currently we have 7 generation algorithms //---------------------------------------------------------------------------------- @@ -35,14 +39,19 @@ 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 //-------------------------------------------------------------------------------------- - int screenWidth = 800; - int screenHeight = 450; - +#if defined(PLATFORM_ANDROID) + InitWindow(screenWidth, screenHeight, app); +#else InitWindow(screenWidth, screenHeight, "raylib [textures] example - procedural images generation"); +#endif Image verticalGradient = GenImageGradientV(screenWidth, screenHeight, RED, BLUE); Image horizontalGradient = GenImageGradientH(screenWidth, screenHeight, RED, BLUE); @@ -90,8 +99,9 @@ int main() CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- - +#if !defined(PLATFORM_ANDROID) return 0; +#endif } //---------------------------------------------------------------------------------- -- cgit v1.2.3