EX sx::RenderObject::RenderObject |
( |
const string & |
id | ) |
|
EX sx::RenderObject::~RenderObject |
( |
| ) |
|
EX void sx::RenderObject::addUniform |
( |
Uniform & |
uniform | ) |
|
Adds a uniform variable to the RenderObject. The uniform's name must be unique in the RenderObject, if another variable with the same name exists, it's replaced by uniform.
EX Mesh* sx::RenderObject::getMesh |
( |
| ) |
|
EX Shader* sx::RenderObject::getShader |
( |
| ) |
|
EX unordered_map<string, Uniform *>& sx::RenderObject::getUniformSet |
( |
const int |
id | ) |
|
Returns the set of uniform variables associated with an integer key. If such a set hasn't existed yet, its created. For each uniform set the mesh with the RenderObject's shader and uniform variables in uniforms and the uniform set is rendered once.
- Parameters
-
id | unique integer associated with the uniform set returned |
- Returns
- uniform set associated with key name
EX bool sx::RenderObject::isLoaded |
( |
| ) |
const |
|
virtual |
as this is always loaded, the return value is always true
Implements sx::SXResource.
EX bool sx::RenderObject::isVisible |
( |
| ) |
const |
EX void sx::RenderObject::load |
( |
| ) |
|
|
virtual |
as this is always loaded, this method has no effect on this
Implements sx::SXResource.
EX void sx::RenderObject::removeInstanceBuffers |
( |
| ) |
|
undoes the changes of setInstanceBuffers
EX void sx::RenderObject::removeUniform |
( |
const string & |
name | ) |
|
Removes the uniform named name. If such a uniform variable doesn't exist, the method does nothing.
EX void sx::RenderObject::removeUniforms |
( |
| ) |
|
EX void sx::RenderObject::removeUniformSet |
( |
const int |
id | ) |
|
Removes the uniform set associated to id. If such a uniform set doesn't exist, the method does nothing.
EX void sx::RenderObject::removeUniformSets |
( |
| ) |
|
EX void sx::RenderObject::render |
( |
Shader * |
passShader | ) |
|
Renders the RenderObject. If no shader is attached to the RenderObject, the shader passShader in the parameter is used. If uniformSets is nonempty, the mesh is rendered once for each set in uniformSets. If instanceBuffers is nonempty, and mesh is a BufferedMesh, the mesh is rendered once for the first k vertices in instanceBuffers, if k is the amount of vertices of the BufferedMesh with the minimum amount of vertices in instanceBuffers. If visible is false, render doesn't do anything. Iff both shaders are null, or mesh is null, render doesn't do anything.
- Parameters
-
passShader | Shader provided by the pass rendering the RenderObject, may be null. If a shader is attached to the RenderObject, its used instead of passShader. |
EX void sx::RenderObject::setInstanceBuffers |
( |
const vector< BufferedMesh * > & |
instanceBuffers | ) |
|
Assigns a set BufferedMeshes to this. this is rendered once for each vertex in instanceBuffers. When this is rendered the k. time the k. vertex of each VertexBuffer can be accessed in the shader as a vertex attribute. If mesh is not a BufferedMesh, this method does not affect the behaviour of method render().
EX void sx::RenderObject::setMesh |
( |
Mesh & |
mesh | ) |
|
EX void sx::RenderObject::setShader |
( |
Shader * |
shader | ) |
|
EX void sx::RenderObject::setVisible |
( |
bool |
visible | ) |
|
The documentation for this class was generated from the following file: