KGLLib
Public Member Functions
KGLLib::Mesh Class Reference

Set of geometry with program and texture(s) More...

#include <mesh.h>

Inheritance diagram for KGLLib::Mesh:
KGLLib::Batch KGLLib::SimpleTerrain

List of all members.

Public Member Functions

 Mesh ()
 Mesh (GeometryBuffer *buffer, int offset, int indexOffset)
virtual void bind ()
virtual void unbind ()
void setTexture (KGLLib::Texture *tex)
KGLLib::Texturetexture () const
virtual void setTexture (int index, KGLLib::Texture *tex)
KGLLib::Texturetexture (int index) const
virtual void setProgram (KGLLib::Program *program)
KGLLib::Programprogram () const

Detailed Description

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.


Constructor & Destructor Documentation

KGLLib::Mesh::Mesh ( )

Creates new Mesh object.

KGLLib::Mesh::Mesh ( GeometryBuffer buffer,
int  offset,
int  indexOffset 
)

Creates new Mesh object, using a shared GeometryBuffer


Member Function Documentation

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]
Returns:
Program used for rendering

Referenced by setProgram().

void KGLLib::Mesh::setProgram ( KGLLib::Program program) [virtual]

Sets the Program used for rendering.

References program().

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
Returns:
Texture used for the given texture unit
KGLLib::Texture* KGLLib::Mesh::texture ( ) const [inline]
Returns:
Texture used for texture unit 0

References texture().

Referenced by texture().

void KGLLib::Mesh::unbind ( ) [virtual]

Unbinds the GeometryBuffer used by this batch.

Reimplemented from KGLLib::Batch.

References KGLLib::Program::unbind().


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