xoreos  0.0.5
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
Graphics::Mesh::Mesh Class Reference

#include <mesh.h>

Inheritance diagram for Graphics::Mesh::Mesh:
Inheritance graph
[legend]
Collaboration diagram for Graphics::Mesh::Mesh:
Collaboration graph
[legend]

Public Member Functions

 Mesh (GLuint type=GL_TRIANGLES, GLuint hint=GL_STATIC_DRAW)
 
 ~Mesh ()
 
VertexBuffergetVertexBuffer ()
 
IndexBuffergetIndexBuffer ()
 
void setName (const Common::UString &name)
 
const Common::UStringgetName () const
 
void setType (GLuint type)
 
GLuint getType () const
 
void setHint (GLuint hint)
 
GLuint getHint () const
 
void init ()
 General mesh initialisation, queuing the mesh for GL resource creation. More...
 
void initGL ()
 
void updateGL ()
 
void destroyGL ()
 
void renderImmediate ()
 
void renderBind ()
 Follows the steps of renderImmediate, but broken into different functions. More...
 
void render ()
 
void renderUnbind ()
 
void useIncrement ()
 
void useDecrement ()
 
uint32 useCount () const
 
const glm::vec3 & getCentre () const
 
float getRadius () const
 
- Public Member Functions inherited from Graphics::GLContainer
 GLContainer ()
 
 ~GLContainer ()
 
void rebuild ()
 
void destroy ()
 
- Public Member Functions inherited from Graphics::Queueable
 Queueable ()
 
virtual ~Queueable ()
 
virtual bool operator< (const Queueable &q) const
 

Protected Member Functions

virtual void doRebuild ()
 Initialise GL components with data taken from vertex buffers. More...
 
virtual void doDestroy ()
 Free GL resources. More...
 
- Protected Member Functions inherited from Graphics::Queueable
bool isInQueue (QueueType queue) const
 
void addToQueue (QueueType queue)
 
void removeFromQueue (QueueType queue)
 
void lockQueue (QueueType queue)
 
void unlockQueue (QueueType queue)
 
void sortQueue (QueueType queue)
 

Protected Attributes

VertexBuffer _vertexBuffer
 
IndexBuffer _indexBuffer
 
GLuint _type
 
GLuint _hint
 

Private Attributes

Common::UString _name
 
uint32 _usageCount
 
GLuint _vao
 Vertex Array Object handle. GL3.x only. More...
 
glm::vec3 _centre
 
glm::vec3 _max
 
glm::vec3 _min
 
float _radius
 

Detailed Description

Definition at line 40 of file mesh.h.

Constructor & Destructor Documentation

◆ Mesh()

Graphics::Mesh::Mesh::Mesh ( GLuint  type = GL_TRIANGLES,
GLuint  hint = GL_STATIC_DRAW 
)

Definition at line 31 of file mesh.cpp.

◆ ~Mesh()

Graphics::Mesh::Mesh::~Mesh ( )

Definition at line 34 of file mesh.cpp.

References destroyGL(), Graphics::kQueueNewTexture, and Graphics::Queueable::removeFromQueue().

Here is the call graph for this function:

Member Function Documentation

◆ destroyGL()

void Graphics::Mesh::Mesh::destroyGL ( )

Definition at line 160 of file mesh.cpp.

References _indexBuffer, _vao, _vertexBuffer, Graphics::IndexBuffer::destroyGL(), and Graphics::VertexBuffer::destroyGL().

Referenced by doDestroy(), doRebuild(), and ~Mesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ doDestroy()

void Graphics::Mesh::Mesh::doDestroy ( )
protectedvirtual

Free GL resources.

Implements Graphics::GLContainer.

Definition at line 285 of file mesh.cpp.

References destroyGL().

Here is the call graph for this function:

◆ doRebuild()

void Graphics::Mesh::Mesh::doRebuild ( )
protectedvirtual

Initialise GL components with data taken from vertex buffers.

Implements Graphics::GLContainer.

Definition at line 276 of file mesh.cpp.

References destroyGL(), and initGL().

Here is the call graph for this function:

◆ getCentre()

const glm::vec3 & Graphics::Mesh::Mesh::getCentre ( ) const

Definition at line 268 of file mesh.cpp.

References _centre.

Referenced by Graphics::Render::RenderQueue::queueItem().

Here is the caller graph for this function:

◆ getHint()

GLuint Graphics::Mesh::Mesh::getHint ( ) const

Definition at line 67 of file mesh.cpp.

References _hint.

◆ getIndexBuffer()

IndexBuffer * Graphics::Mesh::Mesh::getIndexBuffer ( )

◆ getName()

const Common::UString & Graphics::Mesh::Mesh::getName ( ) const

Definition at line 51 of file mesh.cpp.

References _name.

Referenced by Graphics::Mesh::MeshManager::init().

Here is the caller graph for this function:

◆ getRadius()

float Graphics::Mesh::Mesh::getRadius ( ) const

Definition at line 272 of file mesh.cpp.

References _radius.

◆ getType()

GLuint Graphics::Mesh::Mesh::getType ( ) const

Definition at line 59 of file mesh.cpp.

References _type.

◆ getVertexBuffer()

VertexBuffer * Graphics::Mesh::Mesh::getVertexBuffer ( )

◆ init()

void Graphics::Mesh::Mesh::init ( )

◆ initGL()

void Graphics::Mesh::Mesh::initGL ( )

◆ render()

void Graphics::Mesh::Mesh::render ( )

◆ renderBind()

void Graphics::Mesh::Mesh::renderBind ( )

◆ renderImmediate()

void Graphics::Mesh::Mesh::renderImmediate ( )

Definition at line 171 of file mesh.cpp.

References render(), renderBind(), and renderUnbind().

Referenced by Graphics::Aurora::ModelNode::renderGeometryNormal(), and Graphics::Shader::ShaderRenderable::renderImmediate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ renderUnbind()

void Graphics::Mesh::Mesh::renderUnbind ( )

◆ setHint()

void Graphics::Mesh::Mesh::setHint ( GLuint  hint)

Definition at line 63 of file mesh.cpp.

References _hint.

◆ setName()

void Graphics::Mesh::Mesh::setName ( const Common::UString name)

◆ setType()

void Graphics::Mesh::Mesh::setType ( GLuint  type)

Definition at line 55 of file mesh.cpp.

References _type.

◆ updateGL()

void Graphics::Mesh::Mesh::updateGL ( )

Definition at line 155 of file mesh.cpp.

References _indexBuffer, _vertexBuffer, Graphics::IndexBuffer::updateGL(), and Graphics::VertexBuffer::updateGL().

Here is the call graph for this function:

◆ useCount()

uint32 Graphics::Mesh::Mesh::useCount ( ) const

Definition at line 264 of file mesh.cpp.

References _usageCount.

◆ useDecrement()

void Graphics::Mesh::Mesh::useDecrement ( )

Definition at line 258 of file mesh.cpp.

References _usageCount.

Referenced by Graphics::Shader::ShaderRenderable::setMesh(), and Graphics::Shader::ShaderRenderable::~ShaderRenderable().

Here is the caller graph for this function:

◆ useIncrement()

void Graphics::Mesh::Mesh::useIncrement ( )

Definition at line 254 of file mesh.cpp.

References _usageCount.

Referenced by Graphics::Shader::ShaderRenderable::setMesh(), and Graphics::Shader::ShaderRenderable::ShaderRenderable().

Here is the caller graph for this function:

Member Data Documentation

◆ _centre

glm::vec3 Graphics::Mesh::Mesh::_centre
private

Definition at line 99 of file mesh.h.

Referenced by getCentre(), and init().

◆ _hint

GLuint Graphics::Mesh::Mesh::_hint
protected

Definition at line 91 of file mesh.h.

Referenced by getHint(), initGL(), and setHint().

◆ _indexBuffer

IndexBuffer Graphics::Mesh::Mesh::_indexBuffer
protected

Definition at line 82 of file mesh.h.

Referenced by destroyGL(), getIndexBuffer(), initGL(), render(), and updateGL().

◆ _max

glm::vec3 Graphics::Mesh::Mesh::_max
private

Definition at line 100 of file mesh.h.

Referenced by init().

◆ _min

glm::vec3 Graphics::Mesh::Mesh::_min
private

Definition at line 101 of file mesh.h.

Referenced by init().

◆ _name

Common::UString Graphics::Mesh::Mesh::_name
private

Definition at line 94 of file mesh.h.

Referenced by getName(), and setName().

◆ _radius

float Graphics::Mesh::Mesh::_radius
private

Definition at line 102 of file mesh.h.

Referenced by getRadius(), and init().

◆ _type

GLuint Graphics::Mesh::Mesh::_type
protected

Definition at line 90 of file mesh.h.

Referenced by getType(), Graphics::Mesh::MeshFont::render(), render(), and setType().

◆ _usageCount

uint32 Graphics::Mesh::Mesh::_usageCount
private

Definition at line 95 of file mesh.h.

Referenced by useCount(), useDecrement(), and useIncrement().

◆ _vao

GLuint Graphics::Mesh::Mesh::_vao
private

Vertex Array Object handle. GL3.x only.

Definition at line 97 of file mesh.h.

Referenced by destroyGL(), initGL(), and renderBind().

◆ _vertexBuffer

VertexBuffer Graphics::Mesh::Mesh::_vertexBuffer
protected

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