Documenting done.

This commit is contained in:
2022-10-20 07:49:42 -07:00
parent 23df65a241
commit df1ae47624
19 changed files with 243 additions and 123 deletions

View File

@ -45,7 +45,6 @@ namespace Dawn {
void updateProjection();
void lookAt(glm::vec3 position, glm::vec3 look);
void lookAt(glm::vec3 position, glm::vec3 look, glm::vec3 up);
/**

View File

@ -17,7 +17,6 @@ Material::Material(SceneItem &item) :
}
void Material::updateShaderParameters() {
std::cout << "Updating params" << std::endl;
this->colorValues.clear();
this->boolValues.clear();

View File

@ -11,29 +11,56 @@ namespace Dawn {
class Shader;
class Material : public SceneItemComponent {
friend class RenderPipeline;
private:
std::shared_ptr<Shader> shader;
/**
* Internal method that will be invoked to go through and update all of
* the shader parameters whenever the shader is swapped out.
*/
void updateShaderParameters();
public:
std::map<shaderparameter_t, enum ShaderParameterType> parameters;
std::map<shaderparameter_t, struct Color> colorValues;
std::map<shaderparameter_t, bool_t> boolValues;
std::map<shaderparameter_t, glm::mat4> matrixValues;
std::map<shaderparameter_t, glm::vec3> vec3Values;
/**
* Material component constructor.
*
* @param item Scene Item this component belongs to.
*/
Material(SceneItem &item);
/**
* Return the shader this material is currently using.
*
* @return Shader pointer to the currently bound shader.
*/
std::shared_ptr<Shader> getShader();
/**
* Sets the shader for the material to use. This will also clear and
* update all of the parameters from the shaders' default parameter list.
*
* @param shader Shader to set.
*/
void setShader(std::shared_ptr<Shader> shader);
/**
* Protected method that can be called, likely by the render pipeline, to
* set and update all of the shader parameters from this material on to
* the shader.
*
* This method assumes that the shader has already been bound.
*/
void setShaderParameters();
/**
* Overrides the default SceneItemComponent start method.
*/
void start() override;
};
}

View File

@ -12,8 +12,16 @@ namespace Dawn {
public:
std::shared_ptr<Mesh> mesh = nullptr;
/**
* Constructs a MeshRenderer scene item component.
*
* @param item Scene Item this mesh renderer belongs to.
*/
MeshRenderer(SceneItem &item);
/**
* Overrides the default SceneItemComponent start method.
*/
void start() override;
};
}