|
KGLLib
|
Utility class to represent format of a GeometryBuffer. More...
#include <geometrybuffer.h>
Public Types | |
| enum | Format { Vertex3 = 1 << 0, Vertex4 = 1 << 1, Color3 = 1 << 2, Color4 = 1 << 3, Normal3 = 1 << 4, Normal = Normal3, TexCoord2 = 1 << 5 } |
Public Member Functions | |
| GeometryBufferFormat () | |
| GeometryBufferFormat (int vertexCount, int indexCount=0) | |
| GeometryBufferFormat (Format fmt, int vertexCount, int indexCount=0) | |
| void | addVertices (int size) |
| void | addNormals () |
| void | addColors (int size) |
| void | addTexCoords (int size) |
| int | vertexSize () const |
| int | colorSize () const |
| int | normalSize () const |
| int | texCoordSize () const |
| int | vertexCount () const |
| void | setVertexCount (int count) |
| int | indexCount () const |
| void | setIndexCount (int count) |
| bool | isIndexed () const |
Protected Member Functions | |
| void | init (int vertexCount, int indexCount) |
Utility class to represent format of a GeometryBuffer.
GeometryBufferFormat object encapsulates information about a GeometryBuffer object. That information includes which attributes (e.g. vertices, normals, texture coordinates) are stored in the buffer as well as the size (number of components) of each coordinate.
| KGLLib::GeometryBufferFormat::GeometryBufferFormat | ( | ) |
Creates an invalid format.
You will need to specify at least vertex size and count before it can be used.
| void KGLLib::GeometryBufferFormat::addColors | ( | int | size | ) | [inline] |
Sets number of color components to size.
Referenced by KGLLib::Batch::bestBufferFormat().
| void KGLLib::GeometryBufferFormat::addNormals | ( | ) | [inline] |
Sets number of normal components to 3 (normals always have 3 components).
Referenced by KGLLib::Batch::bestBufferFormat().
| void KGLLib::GeometryBufferFormat::addTexCoords | ( | int | size | ) | [inline] |
Sets number of texture coordinate components to size.
Referenced by KGLLib::Batch::bestBufferFormat().
| void KGLLib::GeometryBufferFormat::addVertices | ( | int | size | ) | [inline] |
Sets number of vertex components to size.
This has to be specified before the format is valid and can be used.
Referenced by KGLLib::Batch::bestBufferFormat().
| int KGLLib::GeometryBufferFormat::colorSize | ( | ) | const [inline] |
Referenced by KGLLib::GeometryBuffer::bufferSize().
| int KGLLib::GeometryBufferFormat::indexCount | ( | ) | const [inline] |
If this is 0, then non-indexed rendering will be used and all vertices will be used in sequential order. Otherwise indexed rendering will be used and vertices will be used in order specified by indices.
Referenced by KGLLib::GeometryBuffer::indexBufferSize().
| bool KGLLib::GeometryBufferFormat::isIndexed | ( | ) | const [inline] |
| int KGLLib::GeometryBufferFormat::normalSize | ( | ) | const [inline] |
Referenced by KGLLib::GeometryBuffer::bufferSize().
| int KGLLib::GeometryBufferFormat::texCoordSize | ( | ) | const [inline] |
Referenced by KGLLib::GeometryBuffer::bufferSize().
| int KGLLib::GeometryBufferFormat::vertexCount | ( | ) | const [inline] |
Referenced by KGLLib::GeometryBuffer::bufferSize().
| int KGLLib::GeometryBufferFormat::vertexSize | ( | ) | const [inline] |
Referenced by KGLLib::GeometryBuffer::bufferSize().
1.7.4