diff options
Diffstat (limited to 'tests/projects/android/native_app/raylib_custom_glue/src/main.cpp')
| -rw-r--r-- | tests/projects/android/native_app/raylib_custom_glue/src/main.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
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 <raylib.h> +#include <android/log.h> + +#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; +} |
