// // EditorContext:Editor 层与 SandboxApp 之间的桥接上下文。 // // Editor 是 App 层代码(不属于引擎),它需要的引擎门面与沙盒能力 // 全部经此聚合注入——面板只认识 EditorContext,不反向依赖 main.cpp。 // #ifndef HELLOVULKAN_EDITORCONTEXT_H #define HELLOVULKAN_EDITORCONTEXT_H #include #include #include #include #include // kDisplayViewport / kDisplayDirect #include // 可切换环境(IBL 动态切换):StatsPanel 的 Combo 与 SandboxApp 的 // 加载逻辑共用这一张表(下标即身份)。 inline constexpr const char *kEnvPaths[] = { "assets/textures/venice_dawn_1_4k.hdr", "assets/textures/rooitou_park_4k.hdr", "assets/textures/pink_sunrise_4k.hdr", "assets/textures/birchwood_4k.hdr", }; inline constexpr const char *kEnvNames[] = { "Venice Dawn", "Rooitou Park", "Pink Sunrise", "Birchwood", }; inline constexpr int kEnvCount = 4; inline constexpr int kDefaultEnv = 0; // 沙盒特有状态(面板可选读取,空指针 = 该面板区块不显示) struct EditorContext { // 引擎门面 Engine::Renderer *renderer = nullptr; Engine::ECS::Scene *scene = nullptr; Engine::Assets::AssetManager *assets = nullptr; Engine::Application *app = nullptr; std::function getEnvIndex; // 当前环境表下标 std::function setEnvIndex; // 冻结动画时钟(沙盒 spinners 用;保留原 Scene Debug 行为) bool *pauseAnim = nullptr; }; #endif //HELLOVULKAN_EDITORCONTEXT_H