xoreos  0.0.5
Public Member Functions | List of all members
Graphics::Mesh::MeshFont Class Reference

#include <meshfont.h>

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

Public Member Functions

 MeshFont ()
 
void render (float *pos, float *uv, float *rgba)
 Dynamic data prior to render call. More...
 
- Public Member Functions inherited from Graphics::Mesh::Mesh
 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
 

Additional Inherited Members

- Protected Member Functions inherited from Graphics::Mesh::Mesh
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 inherited from Graphics::Mesh::Mesh
VertexBuffer _vertexBuffer
 
IndexBuffer _indexBuffer
 
GLuint _type
 
GLuint _hint
 

Detailed Description

Definition at line 34 of file meshfont.h.

Constructor & Destructor Documentation

◆ MeshFont()

Graphics::Mesh::MeshFont::MeshFont ( )

Member Function Documentation

◆ render()

void Graphics::Mesh::MeshFont::render ( float *  pos,
float *  uv,
float *  rgba 
)

Dynamic data prior to render call.

This is somewhat simpler than the normal mesh rendering method. There are not indices into the vertex array, so that can be stripped out. It's also assumed that GL_ARRAY_BUFFER is bound, so it can be overwritten entirely with dynamic data. This is the same between GL3 and GL2, so there's no need to check for that.

Also note that this is really a most inefficient way of updating the vertex buffer. Basically creating all vertices on the stack, passing them in here to be copied into an internal vertex buffer, and then updating that internal buffer to server side resources. It could happily be updated directly from stack values.

Alternatively, sub-allocating from a very large pool of vertices and then using an offset (index value start) for the actual draw call is an even better way of doing things. Most text doesn't change per-frame.

Definition at line 96 of file meshfont.cpp.

References Graphics::Mesh::Mesh::_type, Graphics::Mesh::Mesh::_vertexBuffer, Graphics::VertexBuffer::getCount(), Graphics::VertexBuffer::getData(), and Graphics::VertexBuffer::updateGLBound().

Referenced by Graphics::Aurora::ABCFont::render(), and Graphics::Aurora::TextureFont::render().

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

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