Carna  Version 3.3.2
Public Member Functions | Public Attributes | List of all members
Carna::base::Material::ManagedInterface Class Reference

Represents an acquisition of video resources from a particular Material. This realizes the RAII idiom. More...

#include <Material.h>

+ Inheritance diagram for Carna::base::Material::ManagedInterface:
+ Collaboration diagram for Carna::base::Material::ManagedInterface:

Public Member Functions

 ManagedInterface (Material &material)
 Acquires the video resources from material. More...
 
virtual ~ManagedInterface ()
 Releases the video resources previously acquired from the managing geometryFeature. More...
 
void activate (RenderState &renderState) const
 Activates this material by setting the proper shader on the current context, configuring it and tweaking the renderState.
 
const ShaderProgramshader () const
 References the shader of this material.
 

Public Attributes

Materialmaterial
 References the material.
 
- Public Attributes inherited from Carna::base::GeometryFeature::ManagedInterface
GeometryFeaturegeometryFeature
 References the GeometryFeature that manages the video resources that this object interfaces.
 

Additional Inherited Members

- Protected Member Functions inherited from Carna::base::GeometryFeature::ManagedInterface
 ManagedInterface (GeometryFeature &gf)
 Acquires the video resources from gf. More...
 

Detailed Description

Represents an acquisition of video resources from a particular Material. This realizes the RAII idiom.

Author
Leonid Kostrykin
Date
22.2.15 - 18.3.15

Definition at line 263 of file Material.h.

Constructor & Destructor Documentation

◆ ManagedInterface()

Carna::base::Material::ManagedInterface::ManagedInterface ( Material material)

Acquires the video resources from material.

The instantiated ManagedInterface object is only valid within the current OpenGL context. Delete the object in order to release the acquired resources. Usually the resources are uploaded to video memory when they are first acquired, and deleted from video memory when the last acquisition is released. This depends on whether the resources are sharable across OpenGL contexts.

◆ ~ManagedInterface()

virtual Carna::base::Material::ManagedInterface::~ManagedInterface ( )
virtual

Releases the video resources previously acquired from the managing geometryFeature.

Reimplemented from Carna::base::GeometryFeature::ManagedInterface.


The documentation for this class was generated from the following file: