Minor - Start the Doxygen doc - V12.8.0
This commit is contained in:
@@ -3,6 +3,10 @@
|
||||
|
||||
namespace ecs {
|
||||
|
||||
/**
|
||||
* Enum for different shader types used in rendering.
|
||||
* This enum is used to specify the type of shader to be applied to a model.
|
||||
*/
|
||||
enum class ShaderType
|
||||
{
|
||||
CEL_SHADING,
|
||||
@@ -19,17 +23,35 @@ enum class ShaderType
|
||||
|
||||
class ShaderComponent : public Component {
|
||||
public:
|
||||
|
||||
/**
|
||||
* Builder for the ShaderComponent class.
|
||||
* Initializes the active shader to LIGHTING by default.
|
||||
*/
|
||||
ShaderComponent() : m_activeShader(ShaderType::LIGHTING) {}
|
||||
~ShaderComponent() = default;
|
||||
|
||||
void Initialize() override {}
|
||||
void Update(float deltaTime) override {}
|
||||
|
||||
// Getters et setters
|
||||
/**
|
||||
* Get the currently active shader type.
|
||||
* @return The active shader type as a ShaderType enum.
|
||||
*/
|
||||
ShaderType GetActiveShader() const { return m_activeShader; }
|
||||
/**
|
||||
* Set the active shader type.
|
||||
* This method allows changing the shader type used for rendering.
|
||||
* @param shader The shader type to set as a ShaderType enum.
|
||||
*/
|
||||
void SetActiveShader(ShaderType shader) { m_activeShader = shader; }
|
||||
|
||||
// Conversions utiles
|
||||
/**
|
||||
* Set the active shader type from a string.
|
||||
* This method converts a string representation of a shader type to the corresponding ShaderType enum.
|
||||
* @param shaderName The name of the shader type as a string.
|
||||
* @return The ShaderType enum corresponding to the provided string.
|
||||
*/
|
||||
static ShaderType StringToShaderType(const std::string& str) {
|
||||
if (str == "ALPHA_MAPPING") return ShaderType::ALPHA_MAPPING;
|
||||
if (str == "CEL_SHADING") return ShaderType::CEL_SHADING;
|
||||
@@ -44,6 +66,12 @@ public:
|
||||
return ShaderType::TEXTURE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a ShaderType enum to its string representation.
|
||||
* This method provides a string name for each shader type.
|
||||
* @param type The shader type as a ShaderType enum.
|
||||
* @return The name of the shader type as a string.
|
||||
*/
|
||||
static std::string ShaderTypeToString(ShaderType type) {
|
||||
switch (type) {
|
||||
case ShaderType::ALPHA_MAPPING: return "ALPHA_MAPPING";
|
||||
|
||||
Reference in New Issue
Block a user