summaryrefslogtreecommitdiffhomepage
path: root/examples/web/models/models_material_pbr.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/web/models/models_material_pbr.c')
-rw-r--r--examples/web/models/models_material_pbr.c20
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
}
//----------------------------------------------------------------------------------