12#ifndef MATERIAL_H_6014714286
13#define MATERIAL_H_6014714286
15#include <Carna/Carna.h>
18#include <Carna/base/ShaderUniform.h>
180 const std::unique_ptr< Details > pimpl;
216 template<
typename ParameterType >
217 void setParameter(
const std::string& name,
const ParameterType& value );
305template<
typename ParameterType >
Defines Carna::base::GeometryFeature.
Defines Carna::base::ShaderManager.
Represents an association.
Represents an acquisition of the video resources from a particular GeometryFeature....
Represents "components" that are aggregated by Geometry objects. Closer description is given here.
Represents an acquisition of video resources from a particular Material. This realizes the RAII idiom...
ManagedInterface(Material &material)
Acquires the video resources from material.
void activate(RenderState &renderState) const
Activates this material by setting the proper shader on the current context, configuring it and tweak...
const ShaderProgram & shader() const
References the shader of this material.
Material & material
References the material.
virtual ~ManagedInterface()
Releases the video resources previously acquired from the managing geometryFeature.
Specifies the shader and it's configuration that are to be used for rendering a Geometry node with a ...
Material(const std::string &shaderName)
Instantiates.
virtual ManagedInterface * acquireVideoResource() override
Acquires the video resources from this GeometryFeature by returning new instance of a class derived f...
bool hasParameter(const std::string &name) const
Tells whether a paramter named name exists.
void clearParameters()
Removes all previously set parameters.
const std::string shaderName
Identifies this material's shader.
void removeParameter(const std::string &name)
Removes the parameter named name if it exists.
virtual ~Material()
Deletes.
const ShaderUniformBase & parameter(const std::string &name) const
References the paramter named name.
void setParameter(const std::string &name, const ParameterType &value)
void addParameter(ShaderUniformBase *uniform)
Records uniform as shader parameter. This will be uploaded to the shader when the material is activat...
virtual bool controlsSameVideoResource(const GeometryFeature &other) const override
Tells whether this instance maintains the same video resources like other.
static Material & create(const std::string &shaderName)
Instantiates. Call release when you do not need the object any longer.
Manages the OpenGL render state.
Maintains an OpenGL shader program. Realizes the RAII-idiom.
#define NON_COPYABLE
Features class it is placed in as non-copyable.