feat: Initialize GUI service after graphics setup and prepare frame with swapchain extent

This commit is contained in:
2026-01-05 13:34:01 +00:00
parent 490d9469dc
commit 44464c8fc5
2 changed files with 13 additions and 1 deletions

View File

@@ -136,6 +136,17 @@ void ServiceBasedApp::Run() {
graphicsService->InitializeSwapchain();
}
// Initialize GUI service after graphics
auto guiService = registry_.GetService<services::IGuiService>();
auto vulkanDeviceService = registry_.GetService<services::IVulkanDeviceService>();
auto swapchainService = registry_.GetService<services::ISwapchainService>();
if (guiService && vulkanDeviceService && swapchainService) {
guiService->Initialize(vulkanDeviceService->GetDevice(),
vulkanDeviceService->GetPhysicalDevice(),
swapchainService->GetSwapchainImageFormat(),
runtimeConfig_.scriptPath.parent_path());
}
// Run the main application loop with crash recovery
if (crashRecoveryService_) {
bool success = crashRecoveryService_->ExecuteWithTimeout(

View File

@@ -96,7 +96,8 @@ void RenderCoordinatorService::RenderFrame(float time) {
if (guiService_ && guiScriptService_ && guiScriptService_->HasGuiCommands()) {
auto guiCommands = guiScriptService_->LoadGuiCommands();
(void)guiCommands;
auto extent = graphicsService_->GetSwapchainExtent();
guiService_->PrepareFrame(guiCommands, extent.width, extent.height);
}
graphicsService_->EndFrame();