5#ifndef __C_INDEX_BUFFER_H_INCLUDED__
6#define __C_INDEX_BUFFER_H_INCLUDED__
21 virtual ~IIndexList(){};
23 virtual u32 stride()
const =0;
24 virtual u32 size()
const =0;
25 virtual void push_back(
const u32 &element) =0;
26 virtual u32 operator [](
u32 index)
const =0;
27 virtual u32 getLast() =0;
28 virtual void setValue(
u32 index,
u32 value) =0;
29 virtual void set_used(
u32 usedNow) =0;
30 virtual void reallocate(
u32 new_size) =0;
31 virtual u32 allocated_size()
const =0;
32 virtual void* pointer() =0;
37 class CSpecificIndexList :
public IIndexList
42 virtual u32 stride()
const {
return sizeof(T);}
44 virtual u32 size()
const {
return Indices.size();}
46 virtual void push_back(
const u32 &element)
49 Indices.push_back((
const T&)element);
52 virtual u32 operator [](
u32 index)
const
54 return (
u32)(Indices[index]);
57 virtual u32 getLast() {
return (
u32)Indices.getLast();}
59 virtual void setValue(
u32 index,
u32 value)
61 Indices[index]=(T)value;
64 virtual void set_used(
u32 usedNow)
66 Indices.set_used(usedNow);
69 virtual void reallocate(
u32 new_size)
71 Indices.reallocate(new_size);
74 virtual u32 allocated_size()
const
76 return Indices.allocated_size();
79 virtual void* pointer() {
return Indices.pointer();}
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() );
136 NewIndices->push_back((*
Indices)[n]);
172 Indices->setValue(index, value);
187 return Indices->allocated_size();
Axis aligned bounding box in 3d dimensional space.
virtual video::E_INDEX_TYPE getType() const
virtual void setValue(u32 index, u32 value)
virtual u32 allocated_size() const
virtual void push_back(const u32 &element)
CIndexBuffer(const IIndexBuffer &IndexBufferCopy)
virtual void setDirty()
flags the mesh as changed, reloads hardware buffers
virtual u32 getChangedID() const
Get the currently used ID for identification of changes.
CIndexBuffer(video::E_INDEX_TYPE IndexType)
virtual void setType(video::E_INDEX_TYPE IndexType)
virtual void reallocate(u32 new_size)
virtual u32 stride() const
virtual E_HARDWARE_MAPPING getHardwareMappingHint() const
get the current hardware mapping hint
E_HARDWARE_MAPPING MappingHint
virtual void setHardwareMappingHint(E_HARDWARE_MAPPING NewMappingHint)
set the hardware mapping hint, for driver
virtual u32 operator[](u32 index) const
virtual void set_used(u32 usedNow)
virtual u32 size() const =0
virtual video::E_INDEX_TYPE getType() const =0
@ EHM_NEVER
Don't store on the hardware.
Everything in the Irrlicht Engine can be found in this namespace.
unsigned int u32
32 bit unsigned variable.
unsigned short u16
16 bit unsigned variable.