xoreos
0.0.5
|
#include <mesh.h>
Public Member Functions | |
Mesh (GLuint type=GL_TRIANGLES, GLuint hint=GL_STATIC_DRAW) | |
~Mesh () | |
VertexBuffer * | getVertexBuffer () |
IndexBuffer * | getIndexBuffer () |
void | setName (const Common::UString &name) |
const Common::UString & | getName () 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 |
Graphics::Mesh::Mesh::Mesh | ( | GLuint | type = GL_TRIANGLES , |
GLuint | hint = GL_STATIC_DRAW |
||
) |
Graphics::Mesh::Mesh::~Mesh | ( | ) |
Definition at line 34 of file mesh.cpp.
References destroyGL(), Graphics::kQueueNewTexture, and Graphics::Queueable::removeFromQueue().
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().
|
protectedvirtual |
Free GL resources.
Implements Graphics::GLContainer.
Definition at line 285 of file mesh.cpp.
References destroyGL().
|
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().
const glm::vec3 & Graphics::Mesh::Mesh::getCentre | ( | ) | const |
Definition at line 268 of file mesh.cpp.
References _centre.
Referenced by Graphics::Render::RenderQueue::queueItem().
GLuint Graphics::Mesh::Mesh::getHint | ( | ) | const |
IndexBuffer * Graphics::Mesh::Mesh::getIndexBuffer | ( | ) |
Definition at line 43 of file mesh.cpp.
References _indexBuffer.
Referenced by Graphics::Aurora::ModelNode_DragonAge::createIndexBuffer(), Graphics::Aurora::ModelNode_Jade::createMesh(), Graphics::Aurora::ModelNode_NWN2::loadRigid(), Graphics::Aurora::ModelNode_NWN2::loadSkin(), Graphics::Aurora::ModelNode_Witcher::readMesh(), Graphics::Aurora::ModelNode_NWN_Binary::readMesh(), Graphics::Aurora::ModelNode_KotOR::readMesh(), and Graphics::Aurora::ModelNode_Witcher::readTexturePaint().
const Common::UString & Graphics::Mesh::Mesh::getName | ( | ) | const |
Definition at line 51 of file mesh.cpp.
References _name.
Referenced by Graphics::Mesh::MeshManager::init().
float Graphics::Mesh::Mesh::getRadius | ( | ) | const |
GLuint Graphics::Mesh::Mesh::getType | ( | ) | const |
VertexBuffer * Graphics::Mesh::Mesh::getVertexBuffer | ( | ) |
Definition at line 39 of file mesh.cpp.
References _vertexBuffer.
Referenced by Graphics::Aurora::ModelNode_Witcher::buildMaterial(), Graphics::Aurora::ModelNode::buildMaterial(), Graphics::Aurora::ModelNode::createBound(), Graphics::Aurora::ModelNode_Jade::createMesh(), Graphics::Aurora::ModelNode_DragonAge::createVertexBuffer(), Graphics::Aurora::ModelNode::flushBuffers(), Graphics::Aurora::ModelNode_NWN2::loadRigid(), Graphics::Aurora::ModelNode_NWN2::loadSkin(), Graphics::Render::RenderManager::queueRenderable(), Graphics::Aurora::ModelNode_Witcher::readMesh(), Graphics::Aurora::ModelNode_NWN_Binary::readMesh(), Graphics::Aurora::ModelNode_KotOR::readMesh(), Graphics::Aurora::ModelNode_Witcher::readTexturePaint(), Graphics::Aurora::ModelNode::render(), Graphics::Aurora::TextureFont::renderBind(), and Graphics::Aurora::Animation::updateSkinnedModel().
void Graphics::Mesh::Mesh::init | ( | ) |
General mesh initialisation, queuing the mesh for GL resource creation.
Definition at line 71 of file mesh.cpp.
References _centre, _max, _min, _radius, _vertexBuffer, Graphics::Queueable::addToQueue(), Graphics::VertexBuffer::getCount(), Graphics::VertexBuffer::getData(), Graphics::VertexBuffer::getVertexDecl(), Graphics::kQueueNewTexture, and Graphics::Queueable::removeFromQueue().
Referenced by Graphics::Mesh::MeshManager::init(), Graphics::Aurora::ModelNode_Witcher::load(), Graphics::Aurora::ModelNode_DragonAge::load(), Graphics::Aurora::ModelNode_Jade::load(), Graphics::Aurora::ModelNode_KotOR::load(), Graphics::Aurora::ModelNode_NWN2::loadRigid(), Graphics::Aurora::ModelNode_NWN2::loadSkin(), Graphics::Aurora::ModelNode_NWN_Binary::readMesh(), and Graphics::Aurora::ModelNode_Witcher::readTexturePaint().
void Graphics::Mesh::Mesh::initGL | ( | ) |
Definition at line 111 of file mesh.cpp.
References _hint, _indexBuffer, _vao, _vertexBuffer, Graphics::IndexBuffer::getCount(), Graphics::VertexBuffer::getData(), Graphics::IndexBuffer::getIBO(), Graphics::VertexBuffer::getVBO(), Graphics::VertexBuffer::getVertexDecl(), GfxMan, Graphics::IndexBuffer::initGL(), and Graphics::VertexBuffer::initGL().
Referenced by doRebuild().
void Graphics::Mesh::Mesh::render | ( | ) |
Definition at line 209 of file mesh.cpp.
References _indexBuffer, _type, _vertexBuffer, Graphics::IndexBuffer::getCount(), Graphics::VertexBuffer::getCount(), Graphics::IndexBuffer::getIBO(), Graphics::IndexBuffer::getType(), and GfxMan.
Referenced by Graphics::Render::RenderQueue::render(), Graphics::Aurora::ModelNode::renderGeometryEnvMappedOver(), Graphics::Aurora::ModelNode::renderGeometryEnvMappedUnder(), and renderImmediate().
void Graphics::Mesh::Mesh::renderBind | ( | ) |
Follows the steps of renderImmediate, but broken into different functions.
Definition at line 177 of file mesh.cpp.
References _vao, _vertexBuffer, Graphics::VertexBuffer::getData(), Graphics::VertexBuffer::getVBO(), Graphics::VertexBuffer::getVertexDecl(), GfxMan, Graphics::VCOLOR, Graphics::VNORMAL, Graphics::VPOSITION, and Graphics::VTCOORD.
Referenced by Graphics::Render::RenderQueue::render(), Graphics::Aurora::ABCFont::renderBind(), Graphics::Aurora::TextureFont::renderBind(), Graphics::Aurora::ModelNode::renderGeometryEnvMappedOver(), Graphics::Aurora::ModelNode::renderGeometryEnvMappedUnder(), and 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().
void Graphics::Mesh::Mesh::renderUnbind | ( | ) |
Definition at line 227 of file mesh.cpp.
References _vertexBuffer, Graphics::VertexBuffer::getVertexDecl(), GfxMan, Graphics::VCOLOR, Graphics::VNORMAL, Graphics::VPOSITION, and Graphics::VTCOORD.
Referenced by Graphics::Render::RenderQueue::render(), Graphics::Aurora::ModelNode::renderGeometryEnvMappedOver(), Graphics::Aurora::ModelNode::renderGeometryEnvMappedUnder(), renderImmediate(), Graphics::Aurora::ABCFont::renderUnbind(), and Graphics::Aurora::TextureFont::renderUnbind().
void Graphics::Mesh::Mesh::setHint | ( | GLuint | hint | ) |
void Graphics::Mesh::Mesh::setName | ( | const Common::UString & | name | ) |
Definition at line 47 of file mesh.cpp.
References _name.
Referenced by Graphics::Mesh::MeshManager::init(), Graphics::Aurora::ModelNode_Witcher::load(), Graphics::Aurora::ModelNode_DragonAge::load(), Graphics::Aurora::ModelNode_Jade::load(), Graphics::Aurora::ModelNode_KotOR::load(), Graphics::Aurora::ModelNode_NWN2::loadRigid(), Graphics::Aurora::ModelNode_NWN2::loadSkin(), and Graphics::Aurora::ModelNode_NWN_Binary::readMesh().
void Graphics::Mesh::Mesh::setType | ( | GLuint | type | ) |
void Graphics::Mesh::Mesh::updateGL | ( | ) |
Definition at line 155 of file mesh.cpp.
References _indexBuffer, _vertexBuffer, Graphics::IndexBuffer::updateGL(), and Graphics::VertexBuffer::updateGL().
uint32 Graphics::Mesh::Mesh::useCount | ( | ) | const |
Definition at line 264 of file mesh.cpp.
References _usageCount.
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().
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().
|
private |
Definition at line 99 of file mesh.h.
Referenced by getCentre(), and init().
|
protected |
|
protected |
Definition at line 82 of file mesh.h.
Referenced by destroyGL(), getIndexBuffer(), initGL(), render(), and updateGL().
|
private |
|
private |
|
private |
|
private |
Definition at line 102 of file mesh.h.
Referenced by getRadius(), and init().
|
protected |
|
private |
Definition at line 95 of file mesh.h.
Referenced by useCount(), useDecrement(), and useIncrement().
|
private |
Vertex Array Object handle. GL3.x only.
Definition at line 97 of file mesh.h.
Referenced by destroyGL(), initGL(), and renderBind().
|
protected |
Definition at line 81 of file mesh.h.
Referenced by destroyGL(), getVertexBuffer(), init(), initGL(), Graphics::Mesh::MeshFont::MeshFont(), Graphics::Mesh::MeshQuad::MeshQuad(), Graphics::Mesh::MeshWireBox::MeshWireBox(), Graphics::Mesh::MeshFont::render(), render(), renderBind(), renderUnbind(), and updateGL().