#include <glfx.h>
Inheritance diagram for GLFX::VertexComponent:
Sample usage:
struct Vert { float pos[3]; float normal[3]; float texture[2]; float attrib; typedef VertexFormat<VC_VERTEX_3F, VC_NORMAL_3F, VC_TEXTURE0_2F, VC_ATTRIBUTE_1F<0> > Format;
};
Vert verts[100]; fill verts VertexComponent* desc = Vert::Format::Desc(); VertexComponent::EnableClientState(desc); VertexComponent::SetPointers(desc, 0, verts); draw VertexComponent::DisableClientState(desc);
Public Member Functions | |
VertexComponent () | |
VertexComponent (int arr, int id, int num, int tp) | |
Static Public Member Functions | |
static unsigned long | GetByteSize (int type, int count) |
static unsigned long | GetVertexSize (const VertexComponent *desc) |
static void | EnableClientState (const VertexComponent *desc) |
static void | DisableClientState (const VertexComponent *desc) |
static void | SetPointers (const VertexComponent *desc, int stride, void *ptr) |
static const VertexComponent * | FindComponentByArray (const VertexComponent *desc, GLenum array, int index) |
static unsigned long | ComponentOffset (const VertexComponent *desc, const VertexComponent *component) |
Public Attributes | |
GLenum | array |
unsigned long | index |
unsigned long | count |
GLenum | type |
GLFX::VertexComponent::VertexComponent | ( | ) | [inline] |
Default constructor.
GLFX::VertexComponent::VertexComponent | ( | int | arr, | |
int | id, | |||
int | num, | |||
int | tp | |||
) | [inline] |
Sets vertex component.
arr | client array | |
id | texture or attribute identifier | |
num | component count | |
tp | type |
static unsigned long GLFX::VertexComponent::GetByteSize | ( | int | type, | |
int | count | |||
) | [static] |
Returns the size of a vertex component.
type | type of component | |
count | number of elements in component |
static unsigned long GLFX::VertexComponent::GetVertexSize | ( | const VertexComponent * | desc | ) | [static] |
Computes vertex size in bytes.
desc | a pointer to VertexComponent array describing vertex format, last element has to be VC_END |
static void GLFX::VertexComponent::EnableClientState | ( | const VertexComponent * | desc | ) | [static] |
Enables OpenGL client state.
desc | a pointer to VertexComponent array describing vertex format, last element has to be VC_END |
static void GLFX::VertexComponent::DisableClientState | ( | const VertexComponent * | desc | ) | [static] |
Disables OpenGL client state.
desc | a pointer to VertexComponent array describing vertex format, last element has to be VC_END |
static void GLFX::VertexComponent::SetPointers | ( | const VertexComponent * | desc, | |
int | stride, | |||
void * | ptr | |||
) | [static] |
Sets OpenGL array pointers.
desc | a pointer to VertexComponent array describing vertex format, last element has to be VC_END | |
stride | vertex component stride, if 0 assumes that the components are tightly packed. | |
ptr | pointer to vertex array |
static const VertexComponent* GLFX::VertexComponent::FindComponentByArray | ( | const VertexComponent * | desc, | |
GLenum | array, | |||
int | index | |||
) | [static] |
Find a vertex component of given type.
desc | a pointer to VertexComponent array describing vertex format, last element has to be VC_END | |
array | OpenGL array type | |
index | texture or attribute id |
static unsigned long GLFX::VertexComponent::ComponentOffset | ( | const VertexComponent * | desc, | |
const VertexComponent * | component | |||
) | [static] |
Computes offset in bytes of the vertex component.
desc | a pointer to VertexComponent array describing vertex format, last element has to be VC_END | |
component | vertex component of which offset is to be found |
GLenum GLFX::VertexComponent::array |
OpenGL client array. (GL_*_ARRAY).
unsigned long GLFX::VertexComponent::index |
Texture number or vertex attribute identifier.
unsigned long GLFX::VertexComponent::count |
Number of elements.
GLenum GLFX::VertexComponent::type |
Type of component. (GL_* type).