|
KGLLib
|
Set of geometry with program and texture(s) More...
#include <mesh.h>
Public Member Functions | |
| Mesh () | |
| Mesh (GeometryBuffer *buffer, int offset, int indexOffset) | |
| virtual void | bind () |
| virtual void | unbind () |
| void | setTexture (KGLLib::Texture *tex) |
| KGLLib::Texture * | texture () const |
| virtual void | setTexture (int index, KGLLib::Texture *tex) |
| KGLLib::Texture * | texture (int index) const |
| virtual void | setProgram (KGLLib::Program *program) |
| KGLLib::Program * | program () const |
Set of geometry with program and texture(s)
Mesh expands the functionality of Batch by adding a program and textures.
You can specify a Program object and one or multiple Texture objects that are used when rendering the Mesh. Both of those features are optional.
| KGLLib::Mesh::Mesh | ( | ) |
Creates new Mesh object.
| KGLLib::Mesh::Mesh | ( | GeometryBuffer * | buffer, |
| int | offset, | ||
| int | indexOffset | ||
| ) |
Creates new Mesh object, using a shared GeometryBuffer
| void KGLLib::Mesh::bind | ( | ) | [virtual] |
Binds the GeometryBuffer used by this batch.
update() is automatically called if Batch's data has changed.
Reimplemented from KGLLib::Batch.
References KGLLib::Program::bind().
| KGLLib::Program* KGLLib::Mesh::program | ( | ) | const [inline] |
Referenced by setProgram().
| void KGLLib::Mesh::setProgram | ( | KGLLib::Program * | program | ) | [virtual] |
| void KGLLib::Mesh::setTexture | ( | int | index, |
| KGLLib::Texture * | tex | ||
| ) | [virtual] |
Uses given texture in given texture unit for rendering.
Maximum allowed texture unit depends on hardware.
| void KGLLib::Mesh::setTexture | ( | KGLLib::Texture * | tex | ) | [inline] |
Uses given texture in texture unit 0 for rendering.
References setTexture().
Referenced by setTexture().
| KGLLib::Texture * KGLLib::Mesh::texture | ( | int | index | ) | const |
| KGLLib::Texture* KGLLib::Mesh::texture | ( | ) | const [inline] |
| void KGLLib::Mesh::unbind | ( | ) | [virtual] |
Unbinds the GeometryBuffer used by this batch.
Reimplemented from KGLLib::Batch.
References KGLLib::Program::unbind().
1.7.4