5 #ifndef __C_VERTEX_BUFFER_H_INCLUDED__ 6 #define __C_VERTEX_BUFFER_H_INCLUDED__ 21 virtual ~IVertexList(){};
38 class CSpecificVertexList :
public IVertexList
43 virtual u32 stride()
const {
return sizeof(T);}
88 for (
u32 n=0;n<VertexBufferCopy.
size();++n)
100 IVertexList *NewVertices=0;
106 NewVertices=
new CSpecificVertexList<video::S3DVertex>;
111 NewVertices=
new CSpecificVertexList<video::S3DVertex2TCoords>;
116 NewVertices=
new CSpecificVertexList<video::S3DVertexTangents>;
122 NewVertices->reallocate( Vertices->size() );
124 for(
u32 n=0;n<Vertices->size();++n)
125 NewVertices->push_back((*Vertices)[n]);
130 Vertices=NewVertices;
133 virtual void*
getData() {
return Vertices->pointer();}
141 return Vertices->size();
146 Vertices->push_back(element);
151 return (*Vertices)[index];
156 return Vertices->getLast();
161 Vertices->set_used(usedNow);
166 Vertices->reallocate(new_size);
171 return Vertices->allocated_size();
176 return Vertices->pointer();
virtual void setType(video::E_VERTEX_TYPE vertexType)
virtual u32 size() const =0
void set_used(u32 usedNow)
Sets the size of the array and allocates new elements if necessary.
void reallocate(u32 new_size, bool canShrink=true)
Reallocates the array, make it bigger or smaller.
virtual E_HARDWARE_MAPPING getHardwareMappingHint() const
get the current hardware mapping hint
virtual video::S3DVertex & operator[](const u32 index) const
CVertexBuffer(video::E_VERTEX_TYPE vertexType)
virtual video::S3DVertex & getLast()
Everything in the Irrlicht Engine can be found in this namespace.
Don't store on the hardware.
u32 allocated_size() const
Get amount of memory allocated.
virtual u32 stride() const
T & getLast()
Gets last element.
Vertex with two texture coordinates, video::S3DVertex2TCoords.
virtual void set_used(u32 usedNow)
void push_back(const T &element)
Adds an element at back of array.
Vertex with a tangent and binormal vector, video::S3DVertexTangents.
unsigned int u32
32 bit unsigned variable.
Standard vertex type used by the Irrlicht engine, video::S3DVertex.
virtual video::E_VERTEX_TYPE getType() const =0
u32 size() const
Get number of occupied elements of the array.
standard vertex used by the Irrlicht engine.
CVertexBuffer(const IVertexBuffer &VertexBufferCopy)
virtual u32 getChangedID() const
Get the currently used ID for identification of changes.
virtual void setDirty()
flags the mesh as changed, reloads hardware buffers
virtual void push_back(const video::S3DVertex &element)
E_HARDWARE_MAPPING MappingHint
E_VERTEX_TYPE
Enumeration for all vertex types there are.
virtual video::S3DVertex * pointer()
virtual video::E_VERTEX_TYPE getType() const
virtual u32 allocated_size() const
virtual void setHardwareMappingHint(E_HARDWARE_MAPPING NewMappingHint)
set the hardware mapping hint, for driver
T * pointer()
Gets a pointer to the array.
virtual void reallocate(u32 new_size)