mirror of
https://github.com/johndoe6345789/SDL3CPlusPlus.git
synced 2026-04-30 00:24:59 +00:00
- Added support for FreeType font rendering in GuiRenderer, including glyph loading and text rendering capabilities. - Introduced GuiFontConfig structure to manage font settings through configuration. - Updated JsonConfigService to parse and provide GUI font settings from JSON configuration. - Implemented MaterialX shader generation capabilities with a new MaterialXShaderGenerator class. - Enhanced ShaderScriptService to utilize MaterialX for shader generation based on configuration. - Added NullGuiService as a placeholder implementation for GUI service. - Extended IConfigService interface to include methods for retrieving graphics backend, MaterialX, and GUI font configurations. - Updated RuntimeConfig structure to include graphics backend and MaterialX configurations. - Added tests to ensure proper integration of new configuration settings and shader generation functionality.
37 lines
1.1 KiB
C++
37 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include "../interfaces/i_shader_script_service.hpp"
|
|
#include "../interfaces/i_script_engine_service.hpp"
|
|
#include "../interfaces/i_config_service.hpp"
|
|
#include "../interfaces/i_logger.hpp"
|
|
#include "materialx_shader_generator.hpp"
|
|
#include <memory>
|
|
|
|
struct lua_State;
|
|
|
|
namespace sdl3cpp::services::impl {
|
|
|
|
/**
|
|
* @brief Script-facing shader service implementation.
|
|
*/
|
|
class ShaderScriptService : public IShaderScriptService {
|
|
public:
|
|
ShaderScriptService(std::shared_ptr<IScriptEngineService> engineService,
|
|
std::shared_ptr<IConfigService> configService,
|
|
std::shared_ptr<ILogger> logger);
|
|
|
|
std::unordered_map<std::string, ShaderPaths> LoadShaderPathsMap() override;
|
|
|
|
private:
|
|
lua_State* GetLuaState() const;
|
|
ShaderPaths ReadShaderPathsTable(lua_State* L, int index) const;
|
|
std::string ResolveShaderPath(const std::string& path) const;
|
|
|
|
std::shared_ptr<IScriptEngineService> engineService_;
|
|
std::shared_ptr<IConfigService> configService_;
|
|
std::shared_ptr<ILogger> logger_;
|
|
MaterialXShaderGenerator materialxGenerator_;
|
|
};
|
|
|
|
} // namespace sdl3cpp::services::impl
|