5 #ifndef __C_INDEX_BUFFER_H_INCLUDED__ 6 #define __C_INDEX_BUFFER_H_INCLUDED__ 21 virtual ~IIndexList(){};
37 class CSpecificIndexList :
public IIndexList
42 virtual u32 stride()
const {
return sizeof(T);}
54 return (
u32)(Indices[index]);
61 Indices[index]=(T)value;
83 if (
sizeof(T)==
sizeof(
u16))
103 for (
u32 n=0;n<IndexBufferCopy.
size();++n)
115 IIndexList *NewIndices=0;
121 NewIndices=
new CSpecificIndexList<u16>;
126 NewIndices=
new CSpecificIndexList<u32>;
133 NewIndices->reallocate( Indices->size() );
135 for(
u32 n=0;n<Indices->size();++n)
136 NewIndices->push_back((*Indices)[n]);
144 virtual void*
getData() {
return Indices->pointer();}
152 return Indices->size();
157 Indices->push_back(element);
162 return (*Indices)[index];
167 return Indices->getLast();
172 Indices->setValue(index, value);
177 Indices->set_used(usedNow);
182 Indices->reallocate(new_size);
187 return Indices->allocated_size();
192 return Indices->pointer();
virtual void setDirty()
flags the mesh as changed, reloads hardware buffers
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.
CIndexBuffer(video::E_INDEX_TYPE IndexType)
virtual u32 operator[](u32 index) const
u32 allocated_size() const
Get amount of memory allocated.
virtual void push_back(const u32 &element)
Everything in the Irrlicht Engine can be found in this namespace.
Don't store on the hardware.
T & getLast()
Gets last element.
virtual u32 size() const =0
void push_back(const T &element)
Adds an element at back of array.
unsigned short u16
16 bit unsigned variable.
virtual void setType(video::E_INDEX_TYPE IndexType)
virtual E_HARDWARE_MAPPING getHardwareMappingHint() const
get the current hardware mapping hint
virtual video::E_INDEX_TYPE getType() const =0
virtual void setHardwareMappingHint(E_HARDWARE_MAPPING NewMappingHint)
set the hardware mapping hint, for driver
unsigned int u32
32 bit unsigned variable.
virtual void reallocate(u32 new_size)
virtual u32 getChangedID() const
Get the currently used ID for identification of changes.
virtual u32 stride() const
u32 size() const
Get number of occupied elements of the array.
virtual void set_used(u32 usedNow)
virtual void setValue(u32 index, u32 value)
virtual u32 allocated_size() const
virtual video::E_INDEX_TYPE getType() const
T * pointer()
Gets a pointer to the array.
E_HARDWARE_MAPPING MappingHint
CIndexBuffer(const IIndexBuffer &IndexBufferCopy)