2014-12-23 11:29:37 +01:00
|
|
|
namespace Rw {
|
2014-12-24 11:38:25 +01:00
|
|
|
namespace Gl {
|
2014-12-23 11:29:37 +01:00
|
|
|
|
2014-12-24 11:38:25 +01:00
|
|
|
struct AttribDesc
|
2014-12-23 11:29:37 +01:00
|
|
|
{
|
|
|
|
// arguments to glVertexAttribPointer (should use OpenGL types here)
|
2014-12-24 23:52:03 +01:00
|
|
|
// Vertex = 0, TexCoord, Normal, Color, Weight, Bone Index, Extra Color
|
2014-12-23 11:29:37 +01:00
|
|
|
uint32 index;
|
2014-12-23 16:15:11 +01:00
|
|
|
// float = 0, byte, ubyte, short, ushort
|
2014-12-23 11:29:37 +01:00
|
|
|
int32 type;
|
|
|
|
bool32 normalized;
|
|
|
|
int32 size;
|
|
|
|
uint32 stride;
|
|
|
|
uint32 offset;
|
|
|
|
};
|
|
|
|
|
2014-12-24 11:38:25 +01:00
|
|
|
struct InstanceDataHeader : Rw::InstanceDataHeader
|
2014-12-23 11:29:37 +01:00
|
|
|
{
|
|
|
|
int32 numAttribs;
|
2014-12-24 11:38:25 +01:00
|
|
|
AttribDesc *attribs;
|
2014-12-23 11:29:37 +01:00
|
|
|
uint32 dataSize;
|
|
|
|
uint8 *data;
|
2014-12-24 11:38:25 +01:00
|
|
|
|
|
|
|
// needed for rendering
|
|
|
|
uint32 vbo;
|
|
|
|
uint32 ibo;
|
2014-12-23 11:29:37 +01:00
|
|
|
};
|
|
|
|
|
2014-12-24 11:38:25 +01:00
|
|
|
void *DestroyNativeData(void *object, int32, int32);
|
|
|
|
void ReadNativeData(std::istream &stream, int32 len, void *object, int32, int32);
|
|
|
|
void WriteNativeData(std::ostream &stream, int32 len, void *object, int32, int32);
|
|
|
|
int32 GetSizeNativeData(void *object, int32, int32);
|
|
|
|
|
|
|
|
void UploadGeo(Geometry *geo);
|
|
|
|
void SetAttribPointers(InstanceDataHeader *inst);
|
2014-12-23 11:29:37 +01:00
|
|
|
|
|
|
|
}
|
2014-12-24 11:38:25 +01:00
|
|
|
}
|