• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

KGLLib

KGLLib::Mesh

KGLLib::Mesh Class Reference

#include <mesh.h>

Inheritance diagram for KGLLib::Mesh:

Inheritance graph
[legend]

List of all members.


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.

Definition at line 39 of file mesh.h.


Public Member Functions

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

Constructor & Destructor Documentation

KGLLib::Mesh::Mesh (  ) 

Creates new Mesh object.

Definition at line 27 of file mesh.cpp.

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

Creates new Mesh object, using a shared GeometryBuffer.

Definition at line 32 of file mesh.cpp.

KGLLib::Mesh::~Mesh (  )  [virtual]

Definition at line 38 of file mesh.cpp.


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.

Definition at line 64 of file mesh.cpp.

KGLLib::Program* KGLLib::Mesh::program (  )  const [inline]

Returns:
Program used for rendering

Definition at line 81 of file mesh.h.

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

Sets the Program used for rendering.

Definition at line 59 of file mesh.cpp.

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.

Definition at line 42 of file mesh.cpp.

void KGLLib::Mesh::setTexture ( KGLLib::Texture *  tex  )  [inline]

Uses given texture in texture unit 0 for rendering.

Definition at line 58 of file mesh.h.

KGLLib::Texture * KGLLib::Mesh::texture ( int  index  )  const

Returns:
Texture used for the given texture unit

Definition at line 50 of file mesh.cpp.

KGLLib::Texture* KGLLib::Mesh::texture (  )  const [inline]

Returns:
Texture used for texture unit 0

Definition at line 62 of file mesh.h.

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

Unbinds the GeometryBuffer used by this batch.

Reimplemented from KGLLib::Batch.

Definition at line 80 of file mesh.cpp.


The documentation for this class was generated from the following files:
  • mesh.h
  • mesh.cpp

KGLLib

Skip menu "KGLLib"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • KGLLib
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal