#ifndef __GEO_VERTEX_BUFFER__ #define __GEO_VERTEX_BUFFER__ #include "GeoBase.h" #include "GeoVector3.h" #include "GeoVector2.h" #include "GeoSerializable.h" namespace Geometry { /// VertexBuffer interface Class /** * This Structure holds the vertex information used by Meshes and SubMesehs. */ class VertexBuffer : public Serializable { public: /// Default Constructor inline VertexBuffer(): mVertexInfo(VERTEX_EMPTY), mVertexCount(0), mPosition(0), mNormal(0), mTexCoords(0) { } /// Default destructor, releases allocated memory. ~VertexBuffer(); /// Returns a new VertexBuffer with the same data. VertexBuffer* Clone() const; /// Fills this VertexBuffer from a Serializer void Load(Serializer &s); /// Stores data void Save(Serializer &s); unsigned int mVertexInfo; ///< Type of info stored by vertex size_t mVertexCount; ///< Number of vertices Vector3 *mPosition; ///< Position array of each Vertex, only valid if (vertexInfo & VERTEX_POSITON) == true Vector3 *mNormal; ///< Normal array of each Vertex, only valid if (vertexInfo & VERTEX_NORMAL) == true Vector2 *mTexCoords;///< Texture Coordinates array of each Vertex, only valid if (vertexInfo & VERTEX_TEXCOORDS) == true }; } // end of Geometry namespace; #endif