15#ifndef MATERIAL_H_6014714286
16#define MATERIAL_H_6014714286
181 const std::unique_ptr< Details > pimpl;
217 template<
typename ParameterType >
218 void setParameter(
const std::string& name,
const ParameterType& value );
241 float lineWidth()
const;
243 void setLineWidth(
float lineWidth );
309template<
typename ParameterType >
Defines LibCarna::base::GeometryFeature.
Contains forward-declarations.
Defines LibCarna::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...
const ShaderProgram & shader() const
References the shader of this material.
ManagedInterface(Material &material)
Acquires the video resources from material.
virtual ~ManagedInterface()
Releases the video resources previously acquired from the managing geometryFeature.
Material & material
References the material.
void activate(RenderState &renderState) const
Activates this material by setting the proper shader on the current context, configuring it and tweak...
Specifies the shader and it's configuration that are to be used for rendering a Geometry node with a ...
virtual ManagedInterface * acquireVideoResource() override
Acquires the video resources from this GeometryFeature by returning new instance of a class derived f...
void clearParameters()
Removes all previously set parameters.
virtual ~Material()
Deletes.
const std::string shaderName
Identifies this material's shader.
void removeParameter(const std::string &name)
Removes the parameter named name if it exists.
void addParameter(ShaderUniformBase *uniform)
Records uniform as shader parameter. This will be uploaded to the shader when the material is activat...
const ShaderUniformBase & parameter(const std::string &name) const
References the paramter named name.
virtual bool controlsSameVideoResource(const GeometryFeature &other) const override
Tells whether this instance maintains the same video resources like other.
bool hasParameter(const std::string &name) const
Tells whether a paramter named name exists.
Material(const std::string &shaderName)
Instantiates.
static Material & create(const std::string &shaderName)
Instantiates. Call release when you do not need the object any longer.
void setParameter(const std::string &name, const ParameterType &value)
Manages the OpenGL render state.
Maintains an OpenGL shader program. Realizes the RAII-idiom.
Defines LibCarna::base::noncopyable and NON_COPYABLE.
#define NON_COPYABLE
Marks the class that it is placed in as non-copyable.