From 899e4763f2e538b03ebc3709deb040baabe9b460 Mon Sep 17 00:00:00 2001 From: johndoe6345789 Date: Sun, 4 Jan 2026 13:54:02 +0000 Subject: [PATCH] feat: Temporarily disable service initialization in ServiceBasedApp and add GetCurrentCommandBuffer and GetGraphicsQueue methods in GraphicsService --- src/app/service_based_app.cpp | 3 ++- src/services/impl/bullet_physics_service.hpp | 3 +++ src/services/impl/graphics_service.cpp | 20 ++++++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/app/service_based_app.cpp b/src/app/service_based_app.cpp index 0fdaca2..8344bd0 100644 --- a/src/app/service_based_app.cpp +++ b/src/app/service_based_app.cpp @@ -54,7 +54,8 @@ void ServiceBasedApp::Run() { try { // Initialize all services - lifecycleController_->InitializeAll(); + // Temporarily disabled for testing + // lifecycleController_->InitializeAll(); // Create the window auto windowService = registry_.GetService(); diff --git a/src/services/impl/bullet_physics_service.hpp b/src/services/impl/bullet_physics_service.hpp index faea337..b22aca7 100644 --- a/src/services/impl/bullet_physics_service.hpp +++ b/src/services/impl/bullet_physics_service.hpp @@ -20,6 +20,9 @@ public: BulletPhysicsService() = default; ~BulletPhysicsService() override; + // IInitializable interface + void Initialize() override { Initialize(btVector3(0, -9.8f, 0)); } + // IPhysicsService interface void Initialize(const btVector3& gravity = btVector3(0, -9.8f, 0)) override; void Shutdown() noexcept override; diff --git a/src/services/impl/graphics_service.cpp b/src/services/impl/graphics_service.cpp index 10cc7cc..5a811cc 100644 --- a/src/services/impl/graphics_service.cpp +++ b/src/services/impl/graphics_service.cpp @@ -205,4 +205,24 @@ VkFormat GraphicsService::GetSwapchainFormat() const { return swapchainService_->GetFormat(); } +VkCommandBuffer GraphicsService::GetCurrentCommandBuffer() const { + logging::TraceGuard trace("GraphicsService::GetCurrentCommandBuffer"); + + if (!initialized_) { + return VK_NULL_HANDLE; + } + + return renderCommandService_->GetCurrentCommandBuffer(); +} + +VkQueue GraphicsService::GetGraphicsQueue() const { + logging::TraceGuard trace("GraphicsService::GetGraphicsQueue"); + + if (!initialized_) { + return VK_NULL_HANDLE; + } + + return deviceService_->GetGraphicsQueue(); +} + } // namespace sdl3cpp::services::impl \ No newline at end of file