diff options
| author | Ray San <[email protected]> | 2017-11-06 14:19:36 +0100 |
|---|---|---|
| committer | Ray San <[email protected]> | 2017-11-06 14:19:36 +0100 |
| commit | d27a373c8f23071f5f463552b0c056a38aaed4b2 (patch) | |
| tree | 28fd73b4b699a148a692d2fd75dc2ceca218b870 /examples/web/models/models_material_pbr.c | |
| parent | d918334a2e1ce32961c0797a4b13fdd5b4ce5630 (diff) | |
| download | raylib.com-d27a373c8f23071f5f463552b0c056a38aaed4b2.tar.gz raylib.com-d27a373c8f23071f5f463552b0c056a38aaed4b2.zip | |
Examples reviewed to compile for Android
Diffstat (limited to 'examples/web/models/models_material_pbr.c')
| -rw-r--r-- | examples/web/models/models_material_pbr.c | 20 |
1 files changed, 15 insertions, 5 deletions
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 <emscripten/emscripten.h> #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 } //---------------------------------------------------------------------------------- |
