Commit bcdb4977 authored by hybrid's avatar hybrid

Fixed whitespace and line endings.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1446 dfc29bdd-3216-0410-991c-e03cc46cb475
parent bea9e087
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2008 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __C_DYNAMIC_MESHBUFFER_H_INCLUDED__
#define __C_DYNAMIC_MESHBUFFER_H_INCLUDED__
#include "IDynamicMeshBuffer.h"
#include "CVertexBuffer.h"
#include "CIndexBuffer.h"
#include "IDynamicMeshBuffer.h"
#include "CVertexBuffer.h"
#include "CIndexBuffer.h"
namespace irr
{
namespace scene
{
class CDynamicMeshBuffer: public IDynamicMeshBuffer
{
IVertexBuffer *VertexBuffer;
IIndexBuffer *IndexBuffer;
public:
CDynamicMeshBuffer(video::E_VERTEX_TYPE vertexType, video::E_INDEX_TYPE indexType)
{
VertexBuffer=new CVertexBuffer(vertexType);
IndexBuffer=new CIndexBuffer(indexType);
}
~CDynamicMeshBuffer()
{
if (VertexBuffer) VertexBuffer->drop();
if (IndexBuffer) IndexBuffer->drop();
}
virtual IVertexBuffer &getVertexBuffer() const
{
return *VertexBuffer;
}
virtual IIndexBuffer &getIndexBuffer() const
{
return *IndexBuffer;
}
virtual void setVertexBuffer(IVertexBuffer *newVertexBuffer)
{
if (newVertexBuffer) newVertexBuffer->grab();
if (VertexBuffer) VertexBuffer->drop();
VertexBuffer=newVertexBuffer;
}
virtual void setIndexBuffer(IIndexBuffer *newIndexBuffer)
{
if (newIndexBuffer) newIndexBuffer->grab();
if (IndexBuffer) IndexBuffer->drop();
IndexBuffer=newIndexBuffer;
}
//! Get Material of this buffer.
virtual const video::SMaterial& getMaterial() const
{
return Material;
}
//! Get Material of this buffer.
virtual video::SMaterial& getMaterial()
{
return Material;
}
//! Get bounding box
virtual const core::aabbox3d<f32>& getBoundingBox() const
{
return BoundingBox;
}
//! Set bounding box
virtual void setBoundingBox( const core::aabbox3df& box)
{
BoundingBox = box;
}
//! Recalculate bounding box
virtual void recalculateBoundingBox()
{
if (!getVertexBuffer().size())
BoundingBox.reset(0,0,0);
else
{
BoundingBox.reset(getVertexBuffer()[0].Pos);
for (u32 i=1; i<getVertexBuffer().size(); ++i)
BoundingBox.addInternalPoint(getVertexBuffer()[i].Pos);
}
}
video::SMaterial Material;
core::aabbox3d<f32> BoundingBox;
};
class CDynamicMeshBuffer: public IDynamicMeshBuffer
{
public:
//! constructor
CDynamicMeshBuffer(video::E_VERTEX_TYPE vertexType, video::E_INDEX_TYPE indexType)
{
VertexBuffer=new CVertexBuffer(vertexType);
IndexBuffer=new CIndexBuffer(indexType);
}
//! destructor
~CDynamicMeshBuffer()
{
if (VertexBuffer)
VertexBuffer->drop();
if (IndexBuffer)
IndexBuffer->drop();
}
virtual IVertexBuffer &getVertexBuffer() const
{
return *VertexBuffer;
}
virtual IIndexBuffer &getIndexBuffer() const
{
return *IndexBuffer;
}
virtual void setVertexBuffer(IVertexBuffer *newVertexBuffer)
{
if (newVertexBuffer)
newVertexBuffer->grab();
if (VertexBuffer)
VertexBuffer->drop();
VertexBuffer=newVertexBuffer;
}
virtual void setIndexBuffer(IIndexBuffer *newIndexBuffer)
{
if (newIndexBuffer)
newIndexBuffer->grab();
if (IndexBuffer)
IndexBuffer->drop();
IndexBuffer=newIndexBuffer;
}
//! Get Material of this buffer.
virtual const video::SMaterial& getMaterial() const
{
return Material;
}
//! Get Material of this buffer.
virtual video::SMaterial& getMaterial()
{
return Material;
}
//! Get bounding box
virtual const core::aabbox3d<f32>& getBoundingBox() const
{
return BoundingBox;
}
//! Set bounding box
virtual void setBoundingBox( const core::aabbox3df& box)
{
BoundingBox = box;
}
//! Recalculate bounding box
virtual void recalculateBoundingBox()
{
if (!getVertexBuffer().size())
BoundingBox.reset(0,0,0);
else
{
BoundingBox.reset(getVertexBuffer()[0].Pos);
for (u32 i=1; i<getVertexBuffer().size(); ++i)
BoundingBox.addInternalPoint(getVertexBuffer()[i].Pos);
}
}
video::SMaterial Material;
core::aabbox3d<f32> BoundingBox;
private:
IVertexBuffer *VertexBuffer;
IIndexBuffer *IndexBuffer;
};
} // end namespace scene
......
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2008 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __C_INDEX_BUFFER_H_INCLUDED__
#define __C_INDEX_BUFFER_H_INCLUDED__
#include "IIndexBuffer.h"
#include "IIndexBuffer.h"
namespace irr
{
{
namespace scene
{
class CIndexBuffer : public IIndexBuffer
{
class IIndexList
{
public:
virtual u32 stride() const =0;
virtual u32 size() const=0;
virtual void push_back (const u32 &element) =0;
virtual const u32 operator [](u32 index) const=0;
virtual const u32 getLast() =0;
virtual void setValue(u32 index, u32 value) =0;
virtual void set_used(u32 usedNow) =0;
virtual void reallocate(u32 new_size)=0;
virtual u32 allocated_size() const=0;
virtual void* pointer() =0;
virtual video::E_INDEX_TYPE getType()=0;
};
template <class T>
class CSpecificIndexList : public IIndexList
{
public:
core::array<T> Indices;
virtual u32 stride() const {return sizeof(T);}
virtual u32 size() const
{return Indices.size();}
virtual void push_back (const u32 &element)
{Indices.push_back((T&)element);}
virtual const u32 operator [](u32 index) const
{return (u32) (Indices[index]);}
virtual const u32 getLast()
{return (u32)Indices.getLast();}
virtual void setValue(u32 index, u32 value)
{
Indices[index]=(T)value;
}
virtual void set_used(u32 usedNow)
{Indices.set_used(usedNow);}
virtual void reallocate(u32 new_size)
{Indices.reallocate(new_size);}
virtual u32 allocated_size() const
{
return Indices.allocated_size();
}
virtual void* pointer() {return Indices.pointer();}
virtual video::E_INDEX_TYPE getType()
{
if (sizeof(T)==sizeof(u16)) return video::EIT_16BIT;
return video::EIT_32BIT;
}
};
public:
IIndexList *Indices;
CIndexBuffer(video::E_INDEX_TYPE IndexType) :Indices(0), MappingHint(EHM_NEVER), ChangedID(1)
{
setType(IndexType);
}
~CIndexBuffer()
{
if (Indices)
delete Indices;
}
//virtual void setType(video::E_INDEX_TYPE IndexType);
virtual void setType(video::E_INDEX_TYPE IndexType)
{
IIndexList *NewIndices=0;
switch (IndexType)
{
case video::EIT_16BIT:
{
NewIndices=new CSpecificIndexList<u16>;
break;
}
case video::EIT_32BIT:
{
NewIndices=new CSpecificIndexList<u32>;
break;
}
}
if (Indices)
{
NewIndices->reallocate( Indices->size() );
for(u32 n=0;n<Indices->size();++n)
NewIndices->push_back((*Indices)[n]);
delete Indices;
}
Indices=NewIndices;
}
virtual void* getData() {return Indices->pointer();}
virtual video::E_INDEX_TYPE getType(){return Indices->getType();}
virtual u32 stride() const {return Indices->stride();}
virtual u32 size() const
{
return Indices->size();
}
virtual void push_back (const u32 &element)
{
Indices->push_back(element);
}
virtual const u32 operator [](u32 index) const
{
return (*Indices)[index];
}
virtual const u32 getLast()
{
return Indices->getLast();
}
virtual void setValue(u32 index, u32 value)
{
Indices->setValue(index, value);
}
virtual void set_used(u32 usedNow)
{
Indices->set_used(usedNow);
}
virtual void reallocate(u32 new_size)
{
Indices->reallocate(new_size);
}
virtual u32 allocated_size() const
{
return Indices->allocated_size();
}
virtual void* pointer()
{
return Indices->pointer();
}
//! get the current hardware mapping hint
virtual const E_HARDWARE_MAPPING getHardwareMappingHint() const
{
return MappingHint;
}
//! set the hardware mapping hint, for driver
virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint )
{
MappingHint=NewMappingHint;
}
//! flags the mesh as changed, reloads hardware buffers
virtual void setDirty()
{
++ChangedID;
}
//! Get the currently used ID for identification of changes.
/** This shouldn't be used for anything outside the VideoDriver. */
virtual const u32 getChangedID() const {return ChangedID;}
E_HARDWARE_MAPPING MappingHint;
u32 ChangedID;
};
class CIndexBuffer : public IIndexBuffer
{
class IIndexList
{
public:
virtual u32 stride() const =0;
virtual u32 size() const =0;
virtual void push_back(const u32 &element) =0;
virtual u32 operator [](u32 index) const =0;
virtual u32 getLast() =0;
virtual void setValue(u32 index, u32 value) =0;
virtual void set_used(u32 usedNow) =0;
virtual void reallocate(u32 new_size) =0;
virtual u32 allocated_size() const =0;
virtual void* pointer() =0;
virtual video::E_INDEX_TYPE getType() =0;
};
template <class T>
class CSpecificIndexList : public IIndexList
{
public:
core::array<T> Indices;
virtual u32 stride() const {return sizeof(T);}
virtual u32 size() const {return Indices.size();}
virtual void push_back(const u32 &element)
{
Indices.push_back((T&)element);
}
virtual u32 operator [](u32 index) const
{
return (u32)(Indices[index]);
}
virtual u32 getLast() {return (u32)Indices.getLast();}
virtual void setValue(u32 index, u32 value)
{
Indices[index]=(T)value;
}
virtual void set_used(u32 usedNow)
{
Indices.set_used(usedNow);
}
virtual void reallocate(u32 new_size)
{
Indices.reallocate(new_size);
}
virtual u32 allocated_size() const
{
return Indices.allocated_size();
}
virtual void* pointer() {return Indices.pointer();}
virtual video::E_INDEX_TYPE getType()
{
if (sizeof(T)==sizeof(u16))
return video::EIT_16BIT;
return video::EIT_32BIT;
}
};
public:
IIndexList *Indices;
CIndexBuffer(video::E_INDEX_TYPE IndexType) :Indices(0), MappingHint(EHM_NEVER), ChangedID(1)
{
setType(IndexType);
}
~CIndexBuffer()
{
delete Indices;
}
//virtual void setType(video::E_INDEX_TYPE IndexType);
virtual void setType(video::E_INDEX_TYPE IndexType)
{
IIndexList *NewIndices=0;
switch (IndexType)
{
case video::EIT_16BIT:
{
NewIndices=new CSpecificIndexList<u16>;
break;
}
case video::EIT_32BIT:
{
NewIndices=new CSpecificIndexList<u32>;
break;
}
}
if (Indices)
{
NewIndices->reallocate( Indices->size() );
for(u32 n=0;n<Indices->size();++n)
NewIndices->push_back((*Indices)[n]);
delete Indices;
}
Indices=NewIndices;
}
virtual void* getData() {return Indices->pointer();}
virtual video::E_INDEX_TYPE getType(){return Indices->getType();}
virtual u32 stride() const {return Indices->stride();}
virtual u32 size() const
{
return Indices->size();
}
virtual void push_back(const u32 &element)
{
Indices->push_back(element);
}
virtual const u32 operator [](u32 index) const
{
return (*Indices)[index];
}
virtual const u32 getLast()
{
return Indices->getLast();
}
virtual void setValue(u32 index, u32 value)
{
Indices->setValue(index, value);
}
virtual void set_used(u32 usedNow)
{
Indices->set_used(usedNow);
}
virtual void reallocate(u32 new_size)
{
Indices->reallocate(new_size);
}
virtual u32 allocated_size() const
{
return Indices->allocated_size();
}
virtual void* pointer()
{
return Indices->pointer();
}
//! get the current hardware mapping hint
virtual const E_HARDWARE_MAPPING getHardwareMappingHint() const
{
return MappingHint;
}
//! set the hardware mapping hint, for driver
virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint )
{
MappingHint=NewMappingHint;
}
//! flags the mesh as changed, reloads hardware buffers
virtual void setDirty()
{
++ChangedID;
}
//! Get the currently used ID for identification of changes.
/** This shouldn't be used for anything outside the VideoDriver. */
virtual const u32 getChangedID() const {return ChangedID;}
E_HARDWARE_MAPPING MappingHint;
u32 ChangedID;
};
} // end namespace scene
} // end namespace irr
......
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2008 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __C_VERTEX_BUFFER_H_INCLUDED__
#define __C_VERTEX_BUFFER_H_INCLUDED__
#include "IVertexBuffer.h"
#include "IVertexBuffer.h"
namespace irr
{
namespace scene
{
class CVertexBuffer : public IVertexBuffer
{
class IVertexList
{
public:
virtual u32 stride() const =0;
virtual u32 size() const=0;
virtual void push_back (const video::S3DVertex &element) =0;
virtual video::S3DVertex& operator [](const u32 index) const=0;
virtual video::S3DVertex& getLast() =0;
virtual void set_used(u32 usedNow) =0;
virtual void reallocate(u32 new_size)=0;
virtual u32 allocated_size() const =0;
virtual video::S3DVertex* pointer() =0;
virtual video::E_VERTEX_TYPE getType()=0;
};
template <class T>
class CSpecificVertexList : public IVertexList
{
public:
core::array<T> Vertices;
virtual u32 stride() const {return sizeof(T);}
virtual u32 size() const
{return Vertices.size();}
virtual void push_back (const video::S3DVertex &element)
{Vertices.push_back((T&)element);}
virtual video::S3DVertex& operator [](const u32 index) const
{return (video::S3DVertex&)Vertices[index];}
virtual video::S3DVertex& getLast()
{return (video::S3DVertex&)Vertices.getLast();}
virtual void set_used(u32 usedNow)
{Vertices.set_used(usedNow);}
virtual void reallocate(u32 new_size)
{Vertices.reallocate(new_size);}
virtual u32 allocated_size() const
{
return Vertices.allocated_size();
}
virtual video::S3DVertex* pointer() {return Vertices.pointer();}
virtual video::E_VERTEX_TYPE getType(){return T().getType();}
};
public:
IVertexList *Vertices;
CVertexBuffer(video::E_VERTEX_TYPE vertexType) :Vertices(0), MappingHint(EHM_NEVER), ChangedID(1)
{
setType(vertexType);
}
~CVertexBuffer()
{
if (Vertices)
delete Vertices;
}
//virtual void setType(video::E_VERTEX_TYPE vertexType);
virtual void setType(video::E_VERTEX_TYPE vertexType)
{
IVertexList *NewVertices=0;
switch (vertexType)
{
case video::EVT_STANDARD:
{
NewVertices=new CSpecificVertexList<video::S3DVertex>;
break;
}
case video::EVT_2TCOORDS:
{
NewVertices=new CSpecificVertexList<video::S3DVertex2TCoords>;
break;
}
case video::EVT_TANGENTS:
{
NewVertices=new CSpecificVertexList<video::S3DVertexTangents>;
break;
}
}
if (Vertices)
{
NewVertices->reallocate( Vertices->size() );
for(u32 n=0;n<Vertices->size();++n)
NewVertices->push_back((*Vertices)[n]);
delete Vertices;
}
Vertices=NewVertices;
}
virtual void* getData() {return Vertices->pointer();}
virtual video::E_VERTEX_TYPE getType(){return Vertices->getType();}
virtual u32 stride() const {return Vertices->stride();}
virtual u32 size() const
{
return Vertices->size();
}
virtual void push_back (const video::S3DVertex &element)
{
Vertices->push_back(element);
}
virtual video::S3DVertex& operator [](const u32 index) const
{
return (*Vertices)[index];
}
virtual video::S3DVertex& getLast()
{
return Vertices->getLast();
}
virtual void set_used(u32 usedNow)
{
Vertices->set_used(usedNow);
}
virtual void reallocate(u32 new_size)
{
Vertices->reallocate(new_size);
}
virtual u32 allocated_size() const
{
return Vertices->allocated_size();
}
virtual video::S3DVertex* pointer()
{
return Vertices->pointer();
}
//! get the current hardware mapping hint
virtual const E_HARDWARE_MAPPING getHardwareMappingHint() const
{
return MappingHint;
}
//! set the hardware mapping hint, for driver
virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint )
{
MappingHint=NewMappingHint;
}
//! flags the mesh as changed, reloads hardware buffers
virtual void setDirty()
{
++ChangedID;
}
//! Get the currently used ID for identification of changes.
/** This shouldn't be used for anything outside the VideoDriver. */
virtual const u32 getChangedID() const {return ChangedID;}
E_HARDWARE_MAPPING MappingHint;
u32 ChangedID;
};
{
class CVertexBuffer : public IVertexBuffer
{
class IVertexList
{
public:
virtual u32 stride() const =0;
virtual u32 size() const =0;
virtual void push_back (const video::S3DVertex &element) =0;
virtual video::S3DVertex& operator [](const u32 index) const =0;
virtual video::S3DVertex& getLast() =0;
virtual void set_used(u32 usedNow) =0;
virtual void reallocate(u32 new_size) =0;
virtual u32 allocated_size() const =0;
virtual video::S3DVertex* pointer() =0;
virtual video::E_VERTEX_TYPE getType() =0;
};
template <class T>
class CSpecificVertexList : public IVertexList
{
public:
core::array<T> Vertices;
virtual u32 stride() const {return sizeof(T);}
virtual u32 size() const {return Vertices.size();}
virtual void push_back (const video::S3DVertex &element)
{Vertices.push_back((T&)element);}
virtual video::S3DVertex& operator [](const u32 index) const
{return (video::S3DVertex&)Vertices[index];}
virtual video::S3DVertex& getLast()
{return (video::S3DVertex&)Vertices.getLast();}
virtual void set_used(u32 usedNow)
{Vertices.set_used(usedNow);}
virtual void reallocate(u32 new_size)
{Vertices.reallocate(new_size);}
virtual u32 allocated_size() const
{
return Vertices.allocated_size();
}
virtual video::S3DVertex* pointer() {return Vertices.pointer();}
virtual video::E_VERTEX_TYPE getType(){return T().getType();}
};
public:
IVertexList *Vertices;
CVertexBuffer(video::E_VERTEX_TYPE vertexType) :Vertices(0), MappingHint(EHM_NEVER), ChangedID(1)
{
setType(vertexType);
}
~CVertexBuffer()
{
delete Vertices;
}
//virtual void setType(video::E_VERTEX_TYPE vertexType);
virtual void setType(video::E_VERTEX_TYPE vertexType)
{
IVertexList *NewVertices=0;
switch (vertexType)
{
case video::EVT_STANDARD:
{
NewVertices=new CSpecificVertexList<video::S3DVertex>;
break;
}
case video::EVT_2TCOORDS:
{
NewVertices=new CSpecificVertexList<video::S3DVertex2TCoords>;
break;
}
case video::EVT_TANGENTS:
{
NewVertices=new CSpecificVertexList<video::S3DVertexTangents>;
break;
}
}
if (Vertices)
{
NewVertices->reallocate( Vertices->size() );
for(u32 n=0;n<Vertices->size();++n)
NewVertices->push_back((*Vertices)[n]);
delete Vertices;
}
Vertices=NewVertices;
}
virtual void* getData() {return Vertices->pointer();}
virtual video::E_VERTEX_TYPE getType(){return Vertices->getType();}
virtual u32 stride() const {return Vertices->stride();}
virtual u32 size() const
{
return Vertices->size();
}
virtual void push_back (const video::S3DVertex &element)
{
Vertices->push_back(element);
}
virtual video::S3DVertex& operator [](const u32 index) const
{
return (*Vertices)[index];
}
virtual video::S3DVertex& getLast()
{
return Vertices->getLast();
}
virtual void set_used(u32 usedNow)
{
Vertices->set_used(usedNow);
}
virtual void reallocate(u32 new_size)
{
Vertices->reallocate(new_size);
}
virtual u32 allocated_size() const
{
return Vertices->allocated_size();
}
virtual video::S3DVertex* pointer()
{
return Vertices->pointer();
}
//! get the current hardware mapping hint
virtual const E_HARDWARE_MAPPING getHardwareMappingHint() const
{
return MappingHint;
}
//! set the hardware mapping hint, for driver
virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint )
{
MappingHint=NewMappingHint;
}
//! flags the mesh as changed, reloads hardware buffers
virtual void setDirty()
{
++ChangedID;
}
//! Get the currently used ID for identification of changes.
/** This shouldn't be used for anything outside the VideoDriver. */
virtual const u32 getChangedID() const {return ChangedID;}
E_HARDWARE_MAPPING MappingHint;
u32 ChangedID;
};
} // end namespace scene
} // end namespace irr
......
This diff is collapsed.
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2008 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_INDEX_BUFFER_H_INCLUDED__
#define __I_INDEX_BUFFER_H_INCLUDED__
#include "IReferenceCounted.h"
#include "irrArray.h"
#include "SVertexIndex.h"
#include "IReferenceCounted.h"
#include "irrArray.h"
#include "SVertexIndex.h"
namespace irr
{
namespace video
{
}
{
namespace video
{
}
namespace scene
{
class IIndexBuffer : public virtual IReferenceCounted
{
public:
virtual void* getData()=0;
virtual video::E_INDEX_TYPE getType() =0;
virtual void setType(video::E_INDEX_TYPE IndexType) =0;
virtual u32 stride() const =0;
virtual u32 size() const=0;
virtual void push_back (const u32 &element) =0;
virtual const u32 operator [](u32 index) const=0;
virtual const u32 getLast() =0;
virtual void setValue(u32 index, u32 value) =0;
virtual void set_used(u32 usedNow) =0;
virtual void reallocate(u32 new_size)=0;
virtual u32 allocated_size() const=0;
virtual void* pointer() =0;
public:
virtual void* getData() =0;
virtual video::E_INDEX_TYPE getType() =0;
virtual void setType(video::E_INDEX_TYPE IndexType) =0;
virtual u32 stride() const =0;
virtual u32 size() const =0;
virtual void push_back (const u32 &element) =0;
virtual const u32 operator [](u32 index) const =0;
virtual const u32 getLast() =0;
virtual void setValue(u32 index, u32 value) =0;
virtual void set_used(u32 usedNow) =0;
virtual void reallocate(u32 new_size) =0;
virtual u32 allocated_size() const=0;
virtual void* pointer() =0;
//! get the current hardware mapping hint
virtual const E_HARDWARE_MAPPING getHardwareMappingHint() const = 0;
virtual const E_HARDWARE_MAPPING getHardwareMappingHint() const =0;
//! set the hardware mapping hint, for driver
virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint ) = 0;
virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint ) =0;
//! flags the meshbuffer as changed, reloads hardware buffers
virtual void setDirty() = 0;
virtual void setDirty() = 0;
//! Get the currently used ID for identification of changes.
/** This shouldn't be used for anything outside the VideoDriver. */
virtual const u32 getChangedID() const = 0;
};
};
} // end namespace scene
} // end namespace irr
......
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2008 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_VERTEX_BUFFER_H_INCLUDED__
#define __I_VERTEX_BUFFER_H_INCLUDED__
#include "IReferenceCounted.h"
#include "IReferenceCounted.h"
#include "irrArray.h"
#include "S3DVertex.h"
namespace irr
{
......@@ -19,37 +16,34 @@ namespace scene
class IVertexBuffer : public virtual IReferenceCounted
{
public:
virtual void* getData()=0;
virtual video::E_VERTEX_TYPE getType() =0;
virtual void setType(video::E_VERTEX_TYPE vertexType)=0;
virtual u32 stride() const =0;
virtual u32 size() const=0;
virtual void push_back (const video::S3DVertex &element) =0;
virtual video::S3DVertex& operator [](const u32 index) const=0;
virtual video::S3DVertex& getLast() =0;
virtual void set_used(u32 usedNow) =0;
virtual void reallocate(u32 new_size)=0;
virtual u32 allocated_size() const=0;
virtual video::S3DVertex* pointer() =0;
public:
virtual void* getData() =0;
virtual video::E_VERTEX_TYPE getType() =0;
virtual void setType(video::E_VERTEX_TYPE vertexType) =0;
virtual u32 stride() const =0;
virtual u32 size() const =0;
virtual void push_back(const video::S3DVertex &element) =0;
virtual video::S3DVertex& operator [](const u32 index) const =0;
virtual video::S3DVertex& getLast() =0;
virtual void set_used(u32 usedNow) =0;
virtual void reallocate(u32 new_size) =0;
virtual u32 allocated_size() const =0;
virtual video::S3DVertex* pointer() =0;
//! get the current hardware mapping hint
virtual const E_HARDWARE_MAPPING getHardwareMappingHint() const = 0;
virtual const E_HARDWARE_MAPPING getHardwareMappingHint() const =0;
//! set the hardware mapping hint, for driver
virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint ) = 0;
virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint ) =0;
//! flags the meshbuffer as changed, reloads hardware buffers
virtual void setDirty() = 0;
virtual void setDirty() =0;
//! Get the currently used ID for identification of changes.
/** This shouldn't be used for anything outside the VideoDriver. */
virtual const u32 getChangedID() const = 0;
};
};
} // end namespace scene
} // end namespace irr
......
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2008 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
......@@ -12,69 +12,64 @@ namespace irr
{
namespace video
{
enum E_INDEX_TYPE
{
EIT_16BIT = 0,
EIT_32BIT
};
/*
//! vertex index used by the Irrlicht engine.
template <class T>
struct SSpecificVertexIndex
{
T Index;
//! default constructor
SSpecificVertexIndex() {}
//! constructor
SSpecificVertexIndex(u32 _index) :Index(_index) {}
bool operator==(const SSpecificVertexIndex& other) const
{
return (Index == other.Index);
}
bool operator!=(const SSpecificVertexIndex& other) const
{
return (Index != other.Index);
}
bool operator<(const SSpecificVertexIndex& other) const
{
return (Index < other.Index);
}
SSpecificVertexIndex operator+(const u32& other) const
{
return SSpecificVertexIndex(Index + other);
}
operator const u32() const
{
return (const u32)Index;
}
E_INDEX_TYPE getType() const
{
if (sizeof(T)==sizeof(u16)) return video::EIT_16BIT;
return video::EIT_32BIT;
}
};
//typedef SSpecificVertexIndex<u16> SVertexIndex;
typedef u32 SVertexIndex;
*/
enum E_INDEX_TYPE
{
EIT_16BIT = 0,
EIT_32BIT
};
/*
//! vertex index used by the Irrlicht engine.
template <class T>
struct SSpecificVertexIndex
{
T Index;
//! default constructor
SSpecificVertexIndex() {}
//! constructor
SSpecificVertexIndex(u32 _index) :Index(_index) {}
bool operator==(const SSpecificVertexIndex& other) const
{
return (Index == other.Index);
}
bool operator!=(const SSpecificVertexIndex& other) const
{
return (Index != other.Index);
}
bool operator<(const SSpecificVertexIndex& other) const
{
return (Index < other.Index);
}
SSpecificVertexIndex operator+(const u32& other) const
{
return SSpecificVertexIndex(Index + other);
}
operator const u32() const
{
return (const u32)Index;
}
E_INDEX_TYPE getType() const
{
if (sizeof(T)==sizeof(u16))
return video::EIT_16BIT;
return video::EIT_32BIT;
}
};
//typedef SSpecificVertexIndex<u16> SVertexIndex;
typedef u32 SVertexIndex;
*/
} // end namespace video
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment