mirror of
https://github.com/johndoe6345789/SDL3CPlusPlus.git
synced 2026-04-25 06:04:57 +00:00
feat: Temporarily disable service initialization in ServiceBasedApp and add GetCurrentCommandBuffer and GetGraphicsQueue methods in GraphicsService
This commit is contained in:
@@ -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<services::IWindowService>();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user