From d27a373c8f23071f5f463552b0c056a38aaed4b2 Mon Sep 17 00:00:00 2001 From: Ray San Date: Mon, 6 Nov 2017 14:19:36 +0100 Subject: Examples reviewed to compile for Android --- examples/web/models/models_material_pbr.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'examples/web/models/models_material_pbr.c') diff --git a/examples/web/models/models_material_pbr.c b/examples/web/models/models_material_pbr.c index 051384a..768bc73 100644 --- a/examples/web/models/models_material_pbr.c +++ b/examples/web/models/models_material_pbr.c @@ -19,6 +19,10 @@ #include #endif +#if defined(PLATFORM_ANDROID) + #include "android_native_app_glue.h" +#endif + #define CUBEMAP_SIZE 512 // Cubemap texture size #define IRRADIANCE_SIZE 32 // Irradiance texture size #define PREFILTERED_SIZE 256 // Prefiltered HDR environment texture size @@ -46,15 +50,20 @@ static Material LoadMaterialPBR(Color albedo, float metalness, float roughness); //---------------------------------------------------------------------------------- // 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; - SetConfigFlags(FLAG_MSAA_4X_HINT); // Enable Multi Sampling Anti Aliasing 4x (if available) +#if defined(PLATFORM_ANDROID) + InitWindow(screenWidth, screenHeight, app); +#else InitWindow(screenWidth, screenHeight, "raylib [models] example - pbr material"); +#endif // Load model and PBR material model = LoadModel("resources/pbr/trooper.obj"); @@ -90,8 +99,9 @@ int main() CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- - +#if !defined(PLATFORM_ANDROID) return 0; +#endif } //---------------------------------------------------------------------------------- -- cgit v1.2.3