From 7e0454771bb2c3f818ee8a3954f0b4c1866047de Mon Sep 17 00:00:00 2001 From: johndoe6345789 Date: Sat, 10 Jan 2026 12:06:51 +0000 Subject: [PATCH] ROADMAP.md --- src/services/interfaces/i_gui_service.hpp | 4 +- src/services/interfaces/i_mesh_service.hpp | 2 +- src/services/interfaces/i_scene_service.hpp | 2 +- tests/json_config_merge_test.cpp | 18 ------- tests/json_config_schema_validation_test.cpp | 11 +--- tests/render_coordinator_init_order_test.cpp | 53 ++++---------------- 6 files changed, 16 insertions(+), 74 deletions(-) diff --git a/src/services/interfaces/i_gui_service.hpp b/src/services/interfaces/i_gui_service.hpp index 9c59a8a..6943029 100644 --- a/src/services/interfaces/i_gui_service.hpp +++ b/src/services/interfaces/i_gui_service.hpp @@ -11,7 +11,7 @@ struct GuiCommand; /** * @brief GUI rendering service interface. * - * Consumes GUI commands produced by scripts and prepares any per-frame data. + * Consumes GUI commands and prepares per-frame data. */ class IGuiService { public: @@ -20,7 +20,7 @@ public: /** * @brief Prepare GUI commands for rendering. * - * Processes GUI commands from Lua and prepares rendering data. + * Processes GUI commands and prepares rendering data. * * @param commands Vector of GUI commands to render * @param width Viewport width in pixels diff --git a/src/services/interfaces/i_mesh_service.hpp b/src/services/interfaces/i_mesh_service.hpp index 540e8d6..aee93e1 100644 --- a/src/services/interfaces/i_mesh_service.hpp +++ b/src/services/interfaces/i_mesh_service.hpp @@ -6,7 +6,7 @@ namespace sdl3cpp::services { /** - * @brief Script-facing mesh loading service interface. + * @brief Mesh loading service interface. */ class IMeshService { public: diff --git a/src/services/interfaces/i_scene_service.hpp b/src/services/interfaces/i_scene_service.hpp index c9b31d9..7c1a7a5 100644 --- a/src/services/interfaces/i_scene_service.hpp +++ b/src/services/interfaces/i_scene_service.hpp @@ -10,7 +10,7 @@ namespace sdl3cpp::services { * @brief Scene management service interface. * * Maintains the scene graph and generates render commands for the graphics service. - * Separated from script service to decouple scene state from Lua execution. + * Separated from runtime input to decouple scene state from scripting concerns. */ class ISceneService { public: diff --git a/tests/json_config_merge_test.cpp b/tests/json_config_merge_test.cpp index 8d31226..7aea707 100644 --- a/tests/json_config_merge_test.cpp +++ b/tests/json_config_merge_test.cpp @@ -87,29 +87,21 @@ void CopyConfigAssets(const std::filesystem::path& targetDir) { } } -std::filesystem::path WriteLuaScript(const std::filesystem::path& rootDir) { - auto scriptPath = rootDir / "scripts" / "cube_logic.lua"; - WriteFile(scriptPath, "-- test script\n"); - return scriptPath; -} TEST(JsonConfigMergeTest, OverlayOverridesBaseFields) { ScopedTempDir tempDir; CopyConfigAssets(tempDir.Path()); - WriteLuaScript(tempDir.Path()); auto logger = std::make_shared(); const std::string baseConfig = R"({ "schema_version": 2, "configVersion": 2, - "scripts": { "entry": "scripts/cube_logic.lua", "lua_debug": false }, "window": { "size": { "width": 800, "height": 600 } } })"; const std::string overlayConfig = R"({ "schema_version": 2, "configVersion": 2, "extends": "base.json", - "scripts": { "entry": "scripts/cube_logic.lua", "lua_debug": false }, "window": { "size": { "width": 1024 } } })"; @@ -127,13 +119,11 @@ TEST(JsonConfigMergeTest, OverlayOverridesBaseFields) { TEST(JsonConfigMergeTest, DeleteDirectiveRemovesObject) { ScopedTempDir tempDir; CopyConfigAssets(tempDir.Path()); - WriteLuaScript(tempDir.Path()); auto logger = std::make_shared(); const std::string baseConfig = R"({ "schema_version": 2, "configVersion": 2, - "scripts": { "entry": "scripts/cube_logic.lua", "lua_debug": false }, "window": { "title": "Base Title", "mouse_grab": { "enabled": true } @@ -143,7 +133,6 @@ TEST(JsonConfigMergeTest, DeleteDirectiveRemovesObject) { "schema_version": 2, "configVersion": 2, "extends": "base.json", - "scripts": { "entry": "scripts/cube_logic.lua", "lua_debug": false }, "window": { "@delete": ["mouse_grab"], "title": "Overlay Title" @@ -164,26 +153,22 @@ TEST(JsonConfigMergeTest, DeleteDirectiveRemovesObject) { TEST(JsonConfigMergeTest, ExtendsArrayAppliesInOrder) { ScopedTempDir tempDir; CopyConfigAssets(tempDir.Path()); - WriteLuaScript(tempDir.Path()); auto logger = std::make_shared(); const std::string baseOne = R"({ "schema_version": 2, "configVersion": 2, - "scripts": { "entry": "scripts/cube_logic.lua", "lua_debug": false }, "window": { "title": "Base One" } })"; const std::string baseTwo = R"({ "schema_version": 2, "configVersion": 2, - "scripts": { "entry": "scripts/cube_logic.lua", "lua_debug": false }, "window": { "title": "Base Two" } })"; const std::string overlayConfig = R"({ "schema_version": 2, "configVersion": 2, "extends": ["base_one.json", "base_two.json"], - "scripts": { "entry": "scripts/cube_logic.lua", "lua_debug": false } })"; WriteFile(tempDir.Path() / "base_one.json", baseOne); @@ -200,20 +185,17 @@ TEST(JsonConfigMergeTest, ExtendsArrayAppliesInOrder) { TEST(JsonConfigMergeTest, ExtendsCycleThrows) { ScopedTempDir tempDir; CopyConfigAssets(tempDir.Path()); - WriteLuaScript(tempDir.Path()); auto logger = std::make_shared(); const std::string baseA = R"({ "schema_version": 2, "configVersion": 2, "extends": "base_b.json", - "scripts": { "entry": "scripts/cube_logic.lua", "lua_debug": false } })"; const std::string baseB = R"({ "schema_version": 2, "configVersion": 2, "extends": "base_a.json", - "scripts": { "entry": "scripts/cube_logic.lua", "lua_debug": false } })"; WriteFile(tempDir.Path() / "base_a.json", baseA); diff --git a/tests/json_config_schema_validation_test.cpp b/tests/json_config_schema_validation_test.cpp index 7c0188b..4bfe0f6 100644 --- a/tests/json_config_schema_validation_test.cpp +++ b/tests/json_config_schema_validation_test.cpp @@ -87,20 +87,15 @@ void CopyConfigAssets(const std::filesystem::path& targetDir) { } } -void WriteLuaScript(const std::filesystem::path& rootDir) { - WriteFile(rootDir / "scripts" / "cube_logic.lua", "-- test script\n"); -} TEST(JsonConfigSchemaValidationTest, RejectsInvalidWindowWidthType) { ScopedTempDir tempDir; CopyConfigAssets(tempDir.Path()); - WriteLuaScript(tempDir.Path()); auto logger = std::make_shared(); const std::string config = R"({ "schema_version": 2, "configVersion": 2, - "scripts": { "entry": "scripts/cube_logic.lua", "lua_debug": false }, "window": { "size": { "width": "wide", "height": 600 } } })"; @@ -111,17 +106,15 @@ TEST(JsonConfigSchemaValidationTest, RejectsInvalidWindowWidthType) { std::runtime_error); } -TEST(JsonConfigSchemaValidationTest, RejectsInvalidSceneSourceEnum) { +TEST(JsonConfigSchemaValidationTest, RejectsInvalidProjectRootType) { ScopedTempDir tempDir; CopyConfigAssets(tempDir.Path()); - WriteLuaScript(tempDir.Path()); auto logger = std::make_shared(); const std::string config = R"({ "schema_version": 2, "configVersion": 2, - "scripts": { "entry": "scripts/cube_logic.lua", "lua_debug": false }, - "runtime": { "scene_source": "broken" } + "paths": { "project_root": 42 } })"; WriteFile(tempDir.Path() / "config.json", config); diff --git a/tests/render_coordinator_init_order_test.cpp b/tests/render_coordinator_init_order_test.cpp index 7bf050b..732f51a 100644 --- a/tests/render_coordinator_init_order_test.cpp +++ b/tests/render_coordinator_init_order_test.cpp @@ -2,9 +2,8 @@ #include "services/impl/render/render_coordinator_service.hpp" #include "services/interfaces/i_config_compiler_service.hpp" -#include "services/interfaces/i_config_service.hpp" #include "services/interfaces/i_graphics_service.hpp" -#include "services/interfaces/i_shader_script_service.hpp" +#include "services/interfaces/i_shader_system_registry.hpp" #include #include @@ -61,53 +60,21 @@ public: void* GetGraphicsQueue() const override { return nullptr; } }; -class StubShaderScriptService : public sdl3cpp::services::IShaderScriptService { +class StubShaderSystemRegistry : public sdl3cpp::services::IShaderSystemRegistry { public: - std::unordered_map LoadShaderPathsMap() override { + std::unordered_map BuildShaderMap() override { return {}; } -}; - -class StubConfigService final : public sdl3cpp::services::IConfigService { -public: - explicit StubConfigService(sdl3cpp::services::SceneSource sceneSource = sdl3cpp::services::SceneSource::Lua) - : sceneSource_(sceneSource) {} - - uint32_t GetWindowWidth() const override { return 1; } - uint32_t GetWindowHeight() const override { return 1; } - std::filesystem::path GetScriptPath() const override { return {}; } - bool IsLuaDebugEnabled() const override { return false; } - std::string GetWindowTitle() const override { return ""; } - sdl3cpp::services::SceneSource GetSceneSource() const override { - return sceneSource_; + sdl3cpp::services::ShaderReflection GetReflection(const std::string&) const override { + return {}; } - const sdl3cpp::services::InputBindings& GetInputBindings() const override { return inputBindings_; } - const sdl3cpp::services::MouseGrabConfig& GetMouseGrabConfig() const override { return mouseGrabConfig_; } - const sdl3cpp::services::BgfxConfig& GetBgfxConfig() const override { return bgfxConfig_; } - const sdl3cpp::services::MaterialXConfig& GetMaterialXConfig() const override { return materialXConfig_; } - const std::vector& GetMaterialXMaterialConfigs() const override { - return materialXMaterials_; + std::vector GetDefaultTextures( + const std::string&) const override { + return {}; } - const sdl3cpp::services::GuiFontConfig& GetGuiFontConfig() const override { return guiFontConfig_; } - const sdl3cpp::services::RenderBudgetConfig& GetRenderBudgetConfig() const override { return budgets_; } - const sdl3cpp::services::CrashRecoveryConfig& GetCrashRecoveryConfig() const override { return crashRecovery_; } - const sdl3cpp::services::ValidationTourConfig& GetValidationTourConfig() const override { - return validationTour_; + std::string GetActiveSystemId() const override { + return "materialx"; } - const std::string& GetConfigJson() const override { return configJson_; } - -private: - sdl3cpp::services::SceneSource sceneSource_; - sdl3cpp::services::InputBindings inputBindings_{}; - sdl3cpp::services::MouseGrabConfig mouseGrabConfig_{}; - sdl3cpp::services::BgfxConfig bgfxConfig_{}; - sdl3cpp::services::MaterialXConfig materialXConfig_{}; - std::vector materialXMaterials_{}; - sdl3cpp::services::GuiFontConfig guiFontConfig_{}; - sdl3cpp::services::RenderBudgetConfig budgets_{}; - sdl3cpp::services::CrashRecoveryConfig crashRecovery_{}; - sdl3cpp::services::ValidationTourConfig validationTour_{}; - std::string configJson_{}; }; class StubConfigCompilerService final : public sdl3cpp::services::IConfigCompilerService {