Mirror the iOS layout instead of nesting Android inside dm/host:
- dm/android/app GameActivity app (manifest, java, res, build_apk.sh)
- dm/android/Sources front_app.c, touch_app.c, front_headless.c
- dm/android/Makefile entry point (apk / lib / install / headless / tests);
rules in build.mk (was dm/host/Makefile.android),
run with dm/host as cwd; outputs in dm/android/build/
- dm/android/tests t_vk_perf
- dm/gfx/vulkan nvn_vk.c and friends, next to the Metal backend
Only include paths, build paths and docs change; no code changes.
The Mac / iOS source lists do not pick up gfx/vulkan.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
17 lines
1.2 KiB
C
17 lines
1.2 KiB
C
// Vulkan 后端的平台钩子(移植自 dodola/d2r-mobile 的 android/nvn_platform_*):单调时钟 + 前端交给后端的窗口 / 着色器目录
|
||
// Platform hooks of the Vulkan backend (ported from android/nvn_platform_* of dodola/d2r-mobile): monotonic clock + window / shader directory handed over by the front end
|
||
#pragma once
|
||
#include <stddef.h>
|
||
#include <stdint.h>
|
||
#include <time.h>
|
||
static inline uint64_t dm_android_nvn_clock_ns(void) {
|
||
struct timespec t; clock_gettime(CLOCK_MONOTONIC, &t);
|
||
return (uint64_t)t.tv_sec * 1000000000ull + (uint64_t)t.tv_nsec;
|
||
}
|
||
void dm_vk_set_shader_root(const char *path); // 着色器运行包目录(shader_index.bin / *.vkmeta / *.spv.gz) | shader runtime pack directory
|
||
void dm_vk_set_window(void *native); // ANativeWindow*;NULL = 无头(不上屏,只按需读回) | ANativeWindow*; NULL = headless (no swapchain, readback on demand)
|
||
void dm_vk_set_display_hz(int hz);
|
||
// on = 1:没有窗口时出图阻塞到 dm_vk_set_window 给回窗口(App 切后台);0 = 无头照常跑 | on = 1: with no window, present blocks until dm_vk_set_window returns one (app in background); 0 = headless runs as usual
|
||
void dm_vk_hold_without_window(int on);
|
||
void *dm_vk_native_window(void);
|