Go to the documentation of this file.
28 #ifndef __HardwareVertexBuffer__
29 #define __HardwareVertexBuffer__
39 class HardwareBufferManagerBase;
58 virtual bool checkIfVertexInstanceDataIsSupported();
74 void setIsInstanceData(
const bool val);
76 size_t getInstanceDataStepRate()
const;
78 void setInstanceDataStepRate(
const size_t val);
187 unsigned short getSource(
void)
const {
return mSource; }
195 unsigned short getIndex(
void)
const {
return mIndex; }
197 size_t getSize(
void)
const;
233 if (mType != rhs.
mType ||
254 *pElem =
static_cast<void*
>(
255 static_cast<unsigned char*
>(pBase) + mOffset);
269 *pElem =
static_cast<float*
>(
271 static_cast<unsigned char*
>(pBase) + mOffset));
283 *pElem =
static_cast<RGBA*
>(
285 static_cast<unsigned char*
>(pBase) + mOffset));
296 *pElem =
static_cast<unsigned char*
>(pBase) + mOffset;
308 *pElem =
static_cast<unsigned short*
>(
310 static_cast<unsigned char*
>(pBase) + mOffset));
354 const VertexElementList& getElements(
void)
const;
378 void closeGapsInSource(
void);
392 bool vertexAnimation,
bool vertexAnimationNormals)
const;
395 unsigned short getMaxSource(
void)
const;
427 virtual const VertexElement& insertElement(
unsigned short atPosition,
432 virtual void removeElement(
unsigned short elem_index);
443 virtual void removeAllElements(
void);
450 virtual void modifyElement(
unsigned short elem_index,
unsigned short source,
size_t offset,
VertexElementType theType,
468 virtual VertexElementList findElementsBySource(
unsigned short source)
const;
471 virtual size_t getVertexSize(
unsigned short source)
const;
476 virtual unsigned short getNextFreeTextureCoordinate()
const;
489 VertexElementList::const_iterator i, iend, rhsi, rhsiend;
490 iend = mElementList.end();
493 for (i = mElementList.begin(); i != iend && rhsi != rhsiend; ++i, ++rhsi)
495 if ( !(*i == *rhsi) )
503 return !(*
this == rhs);
543 virtual void unsetBinding(
unsigned short index);
546 virtual void unsetAllBindings(
void);
554 virtual bool isBufferBound(
unsigned short index)
const;
563 virtual unsigned short getNextIndex(
void)
const {
return mHighIndex++; }
567 virtual unsigned short getLastBoundIndex(
void)
const;
573 virtual bool hasGaps(
void)
const;
590 virtual bool hasInstanceData()
const;
bool isInstanceData() const
Get if this vertex buffer is an "instance data" buffer (per instance)
void baseVertexPointerToElement(void *pBase, RGBA **pElem) const
Adjusts a pointer to the base of a vertex to point at this element.
@ VES_TEXTURE_COORDINATES
Texture coordinates.
@ VES_TANGENT
Tangent (X axis if normal is Z)
VertexBufferBindingMap mBindingMap
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
void baseVertexPointerToElement(void *pBase, unsigned short **pElem) const
Adjusts a pointer to the base of a vertex to point at this element.
HardwareBufferLockGuard< HardwareVertexBufferSharedPtr > HardwareVertexBufferLockGuard
Locking helper.
void baseVertexPointerToElement(void *pBase, float **pElem) const
Adjusts a pointer to the base of a vertex to point at this element.
@ VES_COUNT
The number of VertexElementSemantic elements (note - the first value VES_POSITION is 1)
unsigned short getSource(void) const
Gets the vertex buffer index from where this element draws it's values.
Base definition of a hardware buffer manager.
unsigned short mIndex
Index of the item, only applicable for some elements like texture coords.
size_t getOffset(void) const
Gets the offset into the buffer where this element starts.
list< VertexElement >::type VertexElementList
Defines the list of vertex elements that makes up this declaration.
size_t getVertexSize(void) const
Gets the size in bytes of a single vertex in this buffer.
void baseVertexPointerToElement(void *pBase, void **pElem) const
Adjusts a pointer to the base of a vertex to point at this element.
unsigned short mSource
The source vertex buffer, as bound to an index using VertexBufferBinding.
size_t getElementCount(void) const
Get the number of elements in the declaration.
unsigned short getIndex(void) const
Gets the index of this element, only applicable for repeating elements.
@ VET_COLOUR_ARGB
D3D style compact colour.
bool operator!=(STLAllocator< T, P > const &, STLAllocator< T2, P > const &)
determine equality, can memory from another allocator be released by this allocator,...
VertexElementSemantic
Vertex element semantics, used to identify the meaning of vertex buffer contents.
Records the state of all the vertex buffer bindings required to provide a vertex declaration with the...
VertexElementType
Vertex element type, used to identify the base types of the vertex contents.
VertexElementSemantic mSemantic
The meaning of the element.
VertexElementSemantic getSemantic(void) const
Gets the meaning of this element.
virtual unsigned short getNextIndex(void) const
Gets the highest index which has already been set, plus 1.
This class declares the format of a set of vertex inputs, which can be issued to the rendering API th...
Shared pointer implementation used to share vertex buffers.
size_t mOffset
The offset in the buffer that this element starts at.
@ VES_BLEND_INDICES
Blending indices.
map< unsigned short, HardwareVertexBufferSharedPtr >::type VertexBufferBindingMap
Defines the vertex buffer bindings used as source for vertex declarations.
@ VES_DIFFUSE
Diffuse colours.
HardwareVertexBufferSharedPtr()
unsigned short mHighIndex
This class declares the usage of a single vertex buffer as a component of a complete VertexDeclaratio...
@ VET_COLOUR
alias to more specific colour type - use the current rendersystem's colour packing
VertexElementType getType(void) const
Gets the data format of this element.
@ VES_BINORMAL
Binormal (Y axis if normal is Z)
VertexElement()
Constructor, should not be called directly, only needed because of list.
Reference-counted shared pointer, used for objects where implicit destruction is required.
HardwareBufferManagerBase * mMgr
void baseVertexPointerToElement(void *pBase, unsigned char **pElem) const
Adjusts a pointer to the base of a vertex to point at this element.
std::map< K, V, P, A > type
Abstract class defining common features of hardware buffers.
Class representing colour.
virtual size_t getBufferCount(void) const
VertexElementType mType
The type of element.
@ VET_COLOUR_ABGR
GL style compact colour.
Specialisation of HardwareBuffer for a vertex buffer.
Usage
Enums describing buffer usage; not mutually exclusive.
@ VES_NORMAL
Normal, 3 reals per vertex.
VertexElementList mElementList
@ VES_SPECULAR
Specular colours.
bool operator==(STLAllocator< T, P > const &, STLAllocator< T2, P > const &)
determine equality, can memory from another allocator be released by this allocator,...
@ VES_BLEND_WEIGHTS
Blending weights.
HardwareBufferManagerBase * getManager() const
Return the manager of this buffer, if any.
size_t mInstanceDataStepRate
map< ushort, ushort >::type BindingIndexMap
size_t getNumVertices(void) const
Get the number of vertices in this buffer.
@ VES_POSITION
Position, 3 reals per vertex.
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Tue Apr 13 2021 08:53:15