Initialize Shader System
Source: client/engine/systems/SystemsFunctions/InitializeShaderSystem.cpp
Purpose: Load and initialize fragment shaders for Shader components.
Components used:
Shader(containsshaderPath,uniforms_float,isLoaded,shadershared_ptr)
Behavior
- For each
Shadernot yet loaded and with a validshaderPath, load ansf::Shaderinto memory. - Initialize the
textureuniform tosf::Shader::CurrentTextureand apply provided float uniforms. - On failure, log an error and reset the
shaderpointer tonullptr.
Main signature
void InitializeShaderSystem(Eng::registry ®,
Eng::sparse_array<Com::Shader> &shaders);
Notes
- Shaders are stored as
std::shared_ptr<sf::Shader>. - Idempotent: the system will not reload a shader already marked
isLoaded.