From 838e5387f94de362bbb58cff2d93ae193b72689f Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 17 Dec 2025 00:35:47 +0800 Subject: add custom glue test --- .../native_app/raylib_custom_glue/src/main.cpp | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tests/projects/android/native_app/raylib_custom_glue/src/main.cpp (limited to 'tests/projects/android/native_app/raylib_custom_glue/src/main.cpp') diff --git a/tests/projects/android/native_app/raylib_custom_glue/src/main.cpp b/tests/projects/android/native_app/raylib_custom_glue/src/main.cpp new file mode 100644 index 000000000..0094d9e3c --- /dev/null +++ b/tests/projects/android/native_app/raylib_custom_glue/src/main.cpp @@ -0,0 +1,32 @@ +#include +#include + +#define LOG_TAG "raydemo_basic" +#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__) + +int main(int argc, char** argv) { + InitWindow(0, 0, "Hello, xmake for raylib android!"); + SetTargetFPS(60); + LOGI("raylib application is running!"); + + while (!WindowShouldClose()) { + BeginDrawing(); + ClearBackground(BLACK); + + // Draw FPS + const char* fpsText = TextFormat("%2i FPS", GetFPS()); + int fpsWidth = MeasureText(fpsText, 40); + DrawText(fpsText, GetScreenWidth() / 2 - fpsWidth / 2, 30, 40, GREEN); + + // Draw centered text + int fontSize = 50; + const char* text = "Hello, xmake for raylib android!"; + int textWidth = MeasureText(text, fontSize); + DrawText(text, GetScreenWidth() / 2 - textWidth / 2, 100, fontSize, BLUE); + + EndDrawing(); + } + + CloseWindow(); + return 0; +} -- cgit v1.3.1