mirror of
https://github.com/johndoe6345789/SDL3CPlusPlus.git
synced 2026-04-24 13:44:58 +00:00
feat: Refactor Shutdown methods to use noexcept and update LoadShaderPathsMap return type
This commit is contained in:
@@ -46,13 +46,6 @@ void GraphicsService::Shutdown() noexcept {
|
||||
initialized_ = false;
|
||||
}
|
||||
|
||||
void GraphicsService::Shutdown() {
|
||||
logging::TraceGuard trace("GraphicsService::Shutdown (IGraphicsService)");
|
||||
|
||||
// Services are shutdown individually by the registry
|
||||
initialized_ = false;
|
||||
}
|
||||
|
||||
void GraphicsService::InitializeDevice(SDL_Window* window, const GraphicsConfig& config) {
|
||||
logging::TraceGuard trace("GraphicsService::InitializeDevice");
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
void InitializeDevice(SDL_Window* window, const GraphicsConfig& config) override;
|
||||
void InitializeSwapchain() override;
|
||||
void RecreateSwapchain() override;
|
||||
void Shutdown() override;
|
||||
void Shutdown() noexcept override;
|
||||
void LoadShaders(const std::unordered_map<std::string, ShaderPaths>& shaders) override;
|
||||
void UploadVertexData(const std::vector<core::Vertex>& vertices) override;
|
||||
void UploadIndexData(const std::vector<uint16_t>& indices) override;
|
||||
|
||||
@@ -66,7 +66,7 @@ std::array<float, 16> LuaScriptService::GetViewProjectionMatrix(float aspect) {
|
||||
return engine_->GetViewProjectionMatrix(aspect);
|
||||
}
|
||||
|
||||
std::unordered_map<std::string, script::ShaderManager::ShaderPaths> LuaScriptService::LoadShaderPathsMap() {
|
||||
std::unordered_map<std::string, sdl3cpp::services::ShaderPaths> LuaScriptService::LoadShaderPathsMap() {
|
||||
logging::TraceGuard trace;
|
||||
|
||||
if (!engine_) {
|
||||
|
||||
@@ -30,7 +30,7 @@ public:
|
||||
std::array<float, 16> ComputeModelMatrix(int functionRef, float time) override;
|
||||
std::array<float, 16> GetViewProjectionMatrix(float aspect) override;
|
||||
|
||||
std::unordered_map<std::string, script::ShaderManager::ShaderPaths> LoadShaderPathsMap() override;
|
||||
std::unordered_map<std::string, sdl3cpp::services::ShaderPaths> LoadShaderPathsMap() override;
|
||||
|
||||
std::vector<script::GuiCommand> LoadGuiCommands() override;
|
||||
void UpdateGuiInput(const script::GuiInputSnapshot& input) override;
|
||||
|
||||
@@ -51,7 +51,6 @@ private:
|
||||
|
||||
// Helper methods
|
||||
void CreateInstance(const std::vector<const char*>& requiredExtensions);
|
||||
void CreateSurface(SDL_Window* window);
|
||||
void PickPhysicalDevice();
|
||||
bool IsDeviceSuitable(VkPhysicalDevice device) const;
|
||||
QueueFamilyIndices FindQueueFamilies(VkPhysicalDevice device) const;
|
||||
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
/**
|
||||
* @brief Shutdown and release all Vulkan resources.
|
||||
*/
|
||||
virtual void Shutdown() = 0;
|
||||
virtual void Shutdown() noexcept = 0;
|
||||
|
||||
/**
|
||||
* @brief Load and compile shader programs.
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
#include <vulkan/vulkan.h>
|
||||
|
||||
namespace sdl3cpp::services {
|
||||
|
||||
/**
|
||||
* @brief Pipeline service interface.
|
||||
*
|
||||
* Manages Vulkan graphics pipelines and shader compilation.
|
||||
* Small, focused service (~200 lines) for pipeline management.
|
||||
|
||||
Reference in New Issue
Block a user