OgreHardwareVertexBuffer.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4  (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2013 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 #ifndef __HardwareVertexBuffer__
29 #define __HardwareVertexBuffer__
30 
31 // Precompiler options
32 #include "OgrePrerequisites.h"
33 #include "OgreHardwareBuffer.h"
34 #include "OgreSharedPtr.h"
35 #include "OgreColourValue.h"
36 #include "OgreHeaderPrefix.h"
37 
38 namespace Ogre {
39  class HardwareBufferManagerBase;
40 
49  {
50  protected:
51 
53  size_t mNumVertices;
54  size_t mVertexSize;
59 
60  public:
62  HardwareVertexBuffer(HardwareBufferManagerBase* mgr, size_t vertexSize, size_t numVertices,
63  HardwareBuffer::Usage usage, bool useSystemMemory, bool useShadowBuffer);
66  HardwareBufferManagerBase* getManager() const { return mMgr; }
68  size_t getVertexSize(void) const { return mVertexSize; }
70  size_t getNumVertices(void) const { return mNumVertices; }
72  bool isInstanceData() const { return mIsInstanceData; }
74  void setIsInstanceData(const bool val);
76  size_t getInstanceDataStepRate() const;
78  void setInstanceDataStepRate(const size_t val);
79 
80 
81  // NB subclasses should override lock, unlock, readData, writeData
82 
83  };
84 
86  class _OgreExport HardwareVertexBufferSharedPtr : public SharedPtr<HardwareVertexBuffer>
87  {
88  public:
91 
92 
93  };
94 
97 
119  VES_COUNT = 9
120  };
121 
124  {
147  VET_USHORT4 = 19,
148  VET_INT1 = 20,
149  VET_INT2 = 21,
150  VET_INT3 = 22,
151  VET_INT4 = 23,
152  VET_UINT1 = 24,
153  VET_UINT2 = 25,
154  VET_UINT3 = 26,
155  VET_UINT4 = 27
156  };
157 
168  {
169  protected:
171  unsigned short mSource;
173  size_t mOffset;
179  unsigned short mIndex;
180  public:
184  VertexElement(unsigned short source, size_t offset, VertexElementType theType,
185  VertexElementSemantic semantic, unsigned short index = 0);
187  unsigned short getSource(void) const { return mSource; }
189  size_t getOffset(void) const { return mOffset; }
191  VertexElementType getType(void) const { return mType; }
193  VertexElementSemantic getSemantic(void) const { return mSemantic; }
195  unsigned short getIndex(void) const { return mIndex; }
197  size_t getSize(void) const;
199  static size_t getTypeSize(VertexElementType etype);
201  static unsigned short getTypeCount(VertexElementType etype);
205  static VertexElementType multiplyTypeCount(VertexElementType baseType, unsigned short count);
210 
218  VertexElementType dstType, uint32* ptr);
219 
226  VertexElementType dst);
227 
230 
231  inline bool operator== (const VertexElement& rhs) const
232  {
233  if (mType != rhs.mType ||
234  mIndex != rhs.mIndex ||
235  mOffset != rhs.mOffset ||
236  mSemantic != rhs.mSemantic ||
237  mSource != rhs.mSource)
238  return false;
239  else
240  return true;
241 
242  }
250  inline void baseVertexPointerToElement(void* pBase, void** pElem) const
251  {
252  // The only way we can do this is to cast to char* in order to use byte offset
253  // then cast back to void*.
254  *pElem = static_cast<void*>(
255  static_cast<unsigned char*>(pBase) + mOffset);
256  }
264  inline void baseVertexPointerToElement(void* pBase, float** pElem) const
265  {
266  // The only way we can do this is to cast to char* in order to use byte offset
267  // then cast back to float*. However we have to go via void* because casting
268  // directly is not allowed
269  *pElem = static_cast<float*>(
270  static_cast<void*>(
271  static_cast<unsigned char*>(pBase) + mOffset));
272  }
273 
281  inline void baseVertexPointerToElement(void* pBase, RGBA** pElem) const
282  {
283  *pElem = static_cast<RGBA*>(
284  static_cast<void*>(
285  static_cast<unsigned char*>(pBase) + mOffset));
286  }
294  inline void baseVertexPointerToElement(void* pBase, unsigned char** pElem) const
295  {
296  *pElem = static_cast<unsigned char*>(pBase) + mOffset;
297  }
298 
306  inline void baseVertexPointerToElement(void* pBase, unsigned short** pElem) const
307  {
308  *pElem = static_cast<unsigned short*>(
309  static_cast<void*>(
310  static_cast<unsigned char*>(pBase) + mOffset));
311  }
312 
313 
314  };
338  {
339  public:
343  static bool vertexElementLess(const VertexElement& e1, const VertexElement& e2);
344  protected:
346  public:
350 
352  size_t getElementCount(void) const { return mElementList.size(); }
354  const VertexElementList& getElements(void) const;
356  const VertexElement* getElement(unsigned short index) const;
357 
366  void sort(void);
367 
378  void closeGapsInSource(void);
379 
392  bool vertexAnimation, bool vertexAnimationNormals) const;
393 
395  unsigned short getMaxSource(void) const;
396 
397 
398 
412  virtual const VertexElement& addElement(unsigned short source, size_t offset, VertexElementType theType,
413  VertexElementSemantic semantic, unsigned short index = 0);
427  virtual const VertexElement& insertElement(unsigned short atPosition,
428  unsigned short source, size_t offset, VertexElementType theType,
429  VertexElementSemantic semantic, unsigned short index = 0);
430 
432  virtual void removeElement(unsigned short elem_index);
433 
440  virtual void removeElement(VertexElementSemantic semantic, unsigned short index = 0);
441 
443  virtual void removeAllElements(void);
444 
450  virtual void modifyElement(unsigned short elem_index, unsigned short source, size_t offset, VertexElementType theType,
451  VertexElementSemantic semantic, unsigned short index = 0);
452 
458  virtual const VertexElement* findElementBySemantic(VertexElementSemantic sem, unsigned short index = 0) const;
468  virtual VertexElementList findElementsBySource(unsigned short source) const;
469 
471  virtual size_t getVertexSize(unsigned short source) const;
472 
476  virtual unsigned short getNextFreeTextureCoordinate() const;
477 
483 
484  inline bool operator== (const VertexDeclaration& rhs) const
485  {
486  if (mElementList.size() != rhs.mElementList.size())
487  return false;
488 
489  VertexElementList::const_iterator i, iend, rhsi, rhsiend;
490  iend = mElementList.end();
491  rhsiend = rhs.mElementList.end();
492  rhsi = rhs.mElementList.begin();
493  for (i = mElementList.begin(); i != iend && rhsi != rhsiend; ++i, ++rhsi)
494  {
495  if ( !(*i == *rhsi) )
496  return false;
497  }
498 
499  return true;
500  }
501  inline bool operator!= (const VertexDeclaration& rhs) const
502  {
503  return !(*this == rhs);
504  }
505 
506  };
507 
522  {
523  public:
526  protected:
528  mutable unsigned short mHighIndex;
529  public:
541  virtual void setBinding(unsigned short index, const HardwareVertexBufferSharedPtr& buffer);
543  virtual void unsetBinding(unsigned short index);
544 
546  virtual void unsetAllBindings(void);
547 
549  virtual const VertexBufferBindingMap& getBindings(void) const;
550 
552  virtual const HardwareVertexBufferSharedPtr& getBuffer(unsigned short index) const;
554  virtual bool isBufferBound(unsigned short index) const;
555 
556  virtual size_t getBufferCount(void) const { return mBindingMap.size(); }
557 
563  virtual unsigned short getNextIndex(void) const { return mHighIndex++; }
564 
567  virtual unsigned short getLastBoundIndex(void) const;
568 
570 
573  virtual bool hasGaps(void) const;
574 
587  virtual void closeGaps(BindingIndexMap& bindingIndexMap);
588 
590  virtual bool hasInstanceData() const;
591 
592 
593  };
599 }
600 
601 #include "OgreHeaderSuffix.h"
602 
603 #endif
604 
OgreSharedPtr.h
OgreHeaderSuffix.h
Ogre::HardwareVertexBuffer::isInstanceData
bool isInstanceData() const
Get if this vertex buffer is an "instance data" buffer (per instance)
Definition: OgreHardwareVertexBuffer.h:72
Ogre::VertexElement::baseVertexPointerToElement
void baseVertexPointerToElement(void *pBase, RGBA **pElem) const
Adjusts a pointer to the base of a vertex to point at this element.
Definition: OgreHardwareVertexBuffer.h:281
Ogre::RGBA
uint32 RGBA
Definition: OgreColourValue.h:41
Ogre::VET_DOUBLE3
@ VET_DOUBLE3
Definition: OgreHardwareVertexBuffer.h:142
Ogre::VES_TEXTURE_COORDINATES
@ VES_TEXTURE_COORDINATES
Texture coordinates.
Definition: OgreHardwareVertexBuffer.h:113
Ogre::VES_TANGENT
@ VES_TANGENT
Tangent (X axis if normal is Z)
Definition: OgreHardwareVertexBuffer.h:117
Ogre::VertexBufferBinding::mBindingMap
VertexBufferBindingMap mBindingMap
Definition: OgreHardwareVertexBuffer.h:527
Ogre::AllocatedObject
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Definition: OgreMemoryAllocatedObject.h:59
Ogre
Definition: OgreAndroidLogListener.h:35
Ogre::VertexDeclaration::modifyElement
virtual void modifyElement(unsigned short elem_index, unsigned short source, size_t offset, VertexElementType theType, VertexElementSemantic semantic, unsigned short index=0)
Modify an element in-place, params as addElement.
Ogre::VET_INT1
@ VET_INT1
Definition: OgreHardwareVertexBuffer.h:148
Ogre::VertexElement::baseVertexPointerToElement
void baseVertexPointerToElement(void *pBase, unsigned short **pElem) const
Adjusts a pointer to the base of a vertex to point at this element.
Definition: OgreHardwareVertexBuffer.h:306
Ogre::map
Definition: OgrePrerequisites.h:534
Ogre::HardwareVertexBufferLockGuard
HardwareBufferLockGuard< HardwareVertexBufferSharedPtr > HardwareVertexBufferLockGuard
Locking helper.
Definition: OgreHardwareVertexBuffer.h:96
Ogre::VET_UINT3
@ VET_UINT3
Definition: OgreHardwareVertexBuffer.h:154
Ogre::VertexDeclaration::getElement
const VertexElement * getElement(unsigned short index) const
Get a single element.
Ogre::VertexBufferBinding::unsetAllBindings
virtual void unsetAllBindings(void)
Removes all the bindings.
Ogre::VertexElement::baseVertexPointerToElement
void baseVertexPointerToElement(void *pBase, float **pElem) const
Adjusts a pointer to the base of a vertex to point at this element.
Definition: OgreHardwareVertexBuffer.h:264
Ogre::VES_COUNT
@ VES_COUNT
The number of VertexElementSemantic elements (note - the first value VES_POSITION is 1)
Definition: OgreHardwareVertexBuffer.h:119
Ogre::VertexElement::getSource
unsigned short getSource(void) const
Gets the vertex buffer index from where this element draws it's values.
Definition: OgreHardwareVertexBuffer.h:187
Ogre::HardwareVertexBuffer::setIsInstanceData
void setIsInstanceData(const bool val)
Set if this vertex buffer is an "instance data" buffer (per instance)
Ogre::HardwareVertexBufferSharedPtr::HardwareVertexBufferSharedPtr
HardwareVertexBufferSharedPtr(HardwareVertexBuffer *buf)
Ogre::HardwareBufferManagerBase
Base definition of a hardware buffer manager.
Definition: OgreHardwareBufferManager.h:114
Ogre::VertexElement::mIndex
unsigned short mIndex
Index of the item, only applicable for some elements like texture coords.
Definition: OgreHardwareVertexBuffer.h:179
Ogre::VertexBufferBinding::setBinding
virtual void setBinding(unsigned short index, const HardwareVertexBufferSharedPtr &buffer)
Set a binding, associating a vertex buffer with a given index.
Ogre::VertexBufferBinding::VertexBufferBinding
VertexBufferBinding()
Constructor, should not be called direct, use HardwareBufferManager::createVertexBufferBinding.
Ogre::HardwareVertexBuffer::mNumVertices
size_t mNumVertices
Definition: OgreHardwareVertexBuffer.h:53
Ogre::VertexElement::getOffset
size_t getOffset(void) const
Gets the offset into the buffer where this element starts.
Definition: OgreHardwareVertexBuffer.h:189
Ogre::VertexDeclaration::VertexElementList
list< VertexElement >::type VertexElementList
Defines the list of vertex elements that makes up this declaration.
Definition: OgreHardwareVertexBuffer.h:341
Ogre::HardwareVertexBuffer::getVertexSize
size_t getVertexSize(void) const
Gets the size in bytes of a single vertex in this buffer.
Definition: OgreHardwareVertexBuffer.h:68
Ogre::VertexDeclaration::clone
virtual VertexDeclaration * clone(HardwareBufferManagerBase *mgr=0) const
Clones this declaration.
Ogre::VertexElement::baseVertexPointerToElement
void baseVertexPointerToElement(void *pBase, void **pElem) const
Adjusts a pointer to the base of a vertex to point at this element.
Definition: OgreHardwareVertexBuffer.h:250
Ogre::VertexElement::convertColourValue
static uint32 convertColourValue(const ColourValue &src, VertexElementType dst)
Utility method for converting colour to a packed 32-bit colour type.
Ogre::VertexBufferBinding::getBindings
virtual const VertexBufferBindingMap & getBindings(void) const
Gets a read-only version of the buffer bindings.
Ogre::VET_DOUBLE2
@ VET_DOUBLE2
Definition: OgreHardwareVertexBuffer.h:141
Ogre::VET_USHORT4
@ VET_USHORT4
Definition: OgreHardwareVertexBuffer.h:147
Ogre::VET_DOUBLE1
@ VET_DOUBLE1
Definition: OgreHardwareVertexBuffer.h:140
Ogre::VET_USHORT3
@ VET_USHORT3
Definition: OgreHardwareVertexBuffer.h:146
Ogre::VertexBufferBinding::hasGaps
virtual bool hasGaps(void) const
Check whether any gaps in the bindings.
Ogre::VertexElement::getTypeCount
static unsigned short getTypeCount(VertexElementType etype)
Utility method which returns the count of values in a given type.
Ogre::uint32
unsigned int uint32
Definition: OgrePlatform.h:359
Ogre::HardwareVertexBuffer::getInstanceDataStepRate
size_t getInstanceDataStepRate() const
Get the number of instances to draw using the same per-instance data before advancing in the buffer b...
Ogre::VertexDeclaration::getNextFreeTextureCoordinate
virtual unsigned short getNextFreeTextureCoordinate() const
Return the index of the next free texture coordinate set which may be added to this declaration.
Ogre::VertexBufferBinding::unsetBinding
virtual void unsetBinding(unsigned short index)
Removes an existing binding.
Ogre::VertexElement::getTypeSize
static size_t getTypeSize(VertexElementType etype)
Utility method for helping to calculate offsets.
Ogre::VertexDeclaration::getVertexSize
virtual size_t getVertexSize(unsigned short source) const
Gets the vertex size defined by this declaration for a given source.
Ogre::VertexElement::mSource
unsigned short mSource
The source vertex buffer, as bound to an index using VertexBufferBinding.
Definition: OgreHardwareVertexBuffer.h:171
Ogre::VertexDeclaration::getElementCount
size_t getElementCount(void) const
Get the number of elements in the declaration.
Definition: OgreHardwareVertexBuffer.h:352
Ogre::VertexBufferBinding::closeGaps
virtual void closeGaps(BindingIndexMap &bindingIndexMap)
Remove any gaps in the bindings.
Ogre::VertexElement::getIndex
unsigned short getIndex(void) const
Gets the index of this element, only applicable for repeating elements.
Definition: OgreHardwareVertexBuffer.h:195
Ogre::VertexDeclaration::insertElement
virtual const VertexElement & insertElement(unsigned short atPosition, unsigned short source, size_t offset, VertexElementType theType, VertexElementSemantic semantic, unsigned short index=0)
Inserts a new VertexElement at a given position in this declaration.
Ogre::VET_COLOUR_ARGB
@ VET_COLOUR_ARGB
D3D style compact colour.
Definition: OgreHardwareVertexBuffer.h:137
Ogre::VET_DOUBLE4
@ VET_DOUBLE4
Definition: OgreHardwareVertexBuffer.h:143
Ogre::VET_SHORT4
@ VET_SHORT4
Definition: OgreHardwareVertexBuffer.h:134
Ogre::operator!=
bool operator!=(STLAllocator< T, P > const &, STLAllocator< T2, P > const &)
determine equality, can memory from another allocator be released by this allocator,...
Definition: OgreMemorySTLAllocator.h:202
Ogre::VET_UINT4
@ VET_UINT4
Definition: OgreHardwareVertexBuffer.h:155
Ogre::VertexElementSemantic
VertexElementSemantic
Vertex element semantics, used to identify the meaning of vertex buffer contents.
Definition: OgreHardwareVertexBuffer.h:99
Ogre::VertexElement::getSize
size_t getSize(void) const
Gets the size of this element in bytes.
Ogre::VertexBufferBinding
Records the state of all the vertex buffer bindings required to provide a vertex declaration with the...
Definition: OgreHardwareVertexBuffer.h:522
Ogre::VertexElement::multiplyTypeCount
static VertexElementType multiplyTypeCount(VertexElementType baseType, unsigned short count)
Simple converter function which will turn a single-value type into a multi-value type based on a para...
Ogre::VertexElementType
VertexElementType
Vertex element type, used to identify the base types of the vertex contents.
Definition: OgreHardwareVertexBuffer.h:124
Ogre::VertexElement::mSemantic
VertexElementSemantic mSemantic
The meaning of the element.
Definition: OgreHardwareVertexBuffer.h:177
Ogre::VertexElement::convertColourValue
static void convertColourValue(VertexElementType srcType, VertexElementType dstType, uint32 *ptr)
Utility method for converting colour from one packed 32-bit colour type to another.
Ogre::VertexElement::getSemantic
VertexElementSemantic getSemantic(void) const
Gets the meaning of this element.
Definition: OgreHardwareVertexBuffer.h:193
OgreHeaderPrefix.h
Ogre::HardwareVertexBuffer::HardwareVertexBuffer
HardwareVertexBuffer(HardwareBufferManagerBase *mgr, size_t vertexSize, size_t numVertices, HardwareBuffer::Usage usage, bool useSystemMemory, bool useShadowBuffer)
Should be called by HardwareBufferManager.
Ogre::VertexBufferBinding::getNextIndex
virtual unsigned short getNextIndex(void) const
Gets the highest index which has already been set, plus 1.
Definition: OgreHardwareVertexBuffer.h:563
Ogre::list
Definition: OgrePrerequisites.h:506
Ogre::VertexDeclaration::~VertexDeclaration
virtual ~VertexDeclaration()
Ogre::VET_USHORT2
@ VET_USHORT2
Definition: OgreHardwareVertexBuffer.h:145
Ogre::VertexDeclaration::getMaxSource
unsigned short getMaxSource(void) const
Gets the index of the highest source value referenced by this declaration.
Ogre::VET_INT3
@ VET_INT3
Definition: OgreHardwareVertexBuffer.h:150
OgrePrerequisites.h
Ogre::VertexDeclaration
This class declares the format of a set of vertex inputs, which can be issued to the rendering API th...
Definition: OgreHardwareVertexBuffer.h:338
Ogre::HardwareVertexBufferSharedPtr
Shared pointer implementation used to share vertex buffers.
Definition: OgreHardwareVertexBuffer.h:87
Ogre::VertexElement::mOffset
size_t mOffset
The offset in the buffer that this element starts at.
Definition: OgreHardwareVertexBuffer.h:173
Ogre::VES_BLEND_INDICES
@ VES_BLEND_INDICES
Blending indices.
Definition: OgreHardwareVertexBuffer.h:105
Ogre::VertexBufferBinding::VertexBufferBindingMap
map< unsigned short, HardwareVertexBufferSharedPtr >::type VertexBufferBindingMap
Defines the vertex buffer bindings used as source for vertex declarations.
Definition: OgreHardwareVertexBuffer.h:525
Ogre::VES_DIFFUSE
@ VES_DIFFUSE
Diffuse colours.
Definition: OgreHardwareVertexBuffer.h:109
Ogre::HardwareVertexBufferSharedPtr::HardwareVertexBufferSharedPtr
HardwareVertexBufferSharedPtr()
Definition: OgreHardwareVertexBuffer.h:89
Ogre::VET_UINT1
@ VET_UINT1
Definition: OgreHardwareVertexBuffer.h:152
Ogre::VertexBufferBinding::mHighIndex
unsigned short mHighIndex
Definition: OgreHardwareVertexBuffer.h:528
Ogre::VertexElement
This class declares the usage of a single vertex buffer as a component of a complete VertexDeclaratio...
Definition: OgreHardwareVertexBuffer.h:168
Ogre::VertexDeclaration::getAutoOrganisedDeclaration
VertexDeclaration * getAutoOrganisedDeclaration(bool skeletalAnimation, bool vertexAnimation, bool vertexAnimationNormals) const
Generates a new VertexDeclaration for optimal usage based on the current vertex declaration,...
Ogre::VertexDeclaration::removeElement
virtual void removeElement(unsigned short elem_index)
Remove the element at the given index from this declaration.
Ogre::VertexDeclaration::VertexDeclaration
VertexDeclaration()
Standard constructor, not you should use HardwareBufferManager::createVertexDeclaration.
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
Ogre::VET_COLOUR
@ VET_COLOUR
alias to more specific colour type - use the current rendersystem's colour packing
Definition: OgreHardwareVertexBuffer.h:130
Ogre::HardwareVertexBuffer::checkIfVertexInstanceDataIsSupported
virtual bool checkIfVertexInstanceDataIsSupported()
Checks if vertex instance data is supported by the render system.
Ogre::VertexDeclaration::addElement
virtual const VertexElement & addElement(unsigned short source, size_t offset, VertexElementType theType, VertexElementSemantic semantic, unsigned short index=0)
Adds a new VertexElement to this declaration.
Ogre::VertexElement::getType
VertexElementType getType(void) const
Gets the data format of this element.
Definition: OgreHardwareVertexBuffer.h:191
Ogre::VertexDeclaration::vertexElementLess
static bool vertexElementLess(const VertexElement &e1, const VertexElement &e2)
Sort routine for vertex elements.
Ogre::VES_BINORMAL
@ VES_BINORMAL
Binormal (Y axis if normal is Z)
Definition: OgreHardwareVertexBuffer.h:115
Ogre::HardwareVertexBuffer::~HardwareVertexBuffer
~HardwareVertexBuffer()
Ogre::HardwareVertexBuffer::setInstanceDataStepRate
void setInstanceDataStepRate(const size_t val)
Set the number of instances to draw using the same per-instance data before advancing in the buffer b...
Ogre::VertexElement::VertexElement
VertexElement()
Constructor, should not be called directly, only needed because of list.
Definition: OgreHardwareVertexBuffer.h:182
Ogre::VertexElement::getBaseType
static VertexElementType getBaseType(VertexElementType multiType)
Simple converter function which will a type into it's single-value equivalent - makes switches on typ...
Ogre::VertexElement::getBestColourVertexElementType
static VertexElementType getBestColourVertexElementType(void)
Utility method to get the most appropriate packed colour vertex element format.
Ogre::VertexDeclaration::findElementBySemantic
virtual const VertexElement * findElementBySemantic(VertexElementSemantic sem, unsigned short index=0) const
Finds a VertexElement with the given semantic, and index if there is more than one element with the s...
Ogre::HardwareVertexBuffer::mVertexSize
size_t mVertexSize
Definition: OgreHardwareVertexBuffer.h:54
Ogre::SharedPtr
Reference-counted shared pointer, used for objects where implicit destruction is required.
Definition: OgreSharedPtr.h:112
Ogre::VertexElement::VertexElement
VertexElement(unsigned short source, size_t offset, VertexElementType theType, VertexElementSemantic semantic, unsigned short index=0)
Constructor, should not be called directly, call VertexDeclaration::addElement.
Ogre::VET_FLOAT2
@ VET_FLOAT2
Definition: OgreHardwareVertexBuffer.h:126
Ogre::HardwareVertexBuffer::mMgr
HardwareBufferManagerBase * mMgr
Definition: OgreHardwareVertexBuffer.h:52
Ogre::VertexElement::baseVertexPointerToElement
void baseVertexPointerToElement(void *pBase, unsigned char **pElem) const
Adjusts a pointer to the base of a vertex to point at this element.
Definition: OgreHardwareVertexBuffer.h:294
Ogre::VET_SHORT3
@ VET_SHORT3
Definition: OgreHardwareVertexBuffer.h:133
Ogre::VertexDeclaration::closeGapsInSource
void closeGapsInSource(void)
Remove any gaps in the source buffer list used by this declaration.
Ogre::VertexBufferBinding::~VertexBufferBinding
virtual ~VertexBufferBinding()
Ogre::VET_UBYTE4
@ VET_UBYTE4
Definition: OgreHardwareVertexBuffer.h:135
Ogre::VertexBufferBinding::getBuffer
virtual const HardwareVertexBufferSharedPtr & getBuffer(unsigned short index) const
Gets the buffer bound to the given source index.
Ogre::map::type
std::map< K, V, P, A > type
Definition: OgrePrerequisites.h:536
Ogre::HardwareBuffer
Abstract class defining common features of hardware buffers.
Definition: OgreHardwareBuffer.h:75
OgreColourValue.h
Ogre::VET_INT2
@ VET_INT2
Definition: OgreHardwareVertexBuffer.h:149
Ogre::ColourValue
Class representing colour.
Definition: OgreColourValue.h:58
Ogre::VertexBufferBinding::getBufferCount
virtual size_t getBufferCount(void) const
Definition: OgreHardwareVertexBuffer.h:556
Ogre::VertexElement::mType
VertexElementType mType
The type of element.
Definition: OgreHardwareVertexBuffer.h:175
Ogre::VET_COLOUR_ABGR
@ VET_COLOUR_ABGR
GL style compact colour.
Definition: OgreHardwareVertexBuffer.h:139
Ogre::VET_FLOAT1
@ VET_FLOAT1
Definition: OgreHardwareVertexBuffer.h:125
Ogre::HardwareVertexBuffer
Specialisation of HardwareBuffer for a vertex buffer.
Definition: OgreHardwareVertexBuffer.h:49
Ogre::HardwareBuffer::Usage
Usage
Enums describing buffer usage; not mutually exclusive.
Definition: OgreHardwareBuffer.h:80
Ogre::VertexBufferBinding::getLastBoundIndex
virtual unsigned short getLastBoundIndex(void) const
Gets the last bound index.
Ogre::VES_NORMAL
@ VES_NORMAL
Normal, 3 reals per vertex.
Definition: OgreHardwareVertexBuffer.h:107
Ogre::VertexBufferBinding::isBufferBound
virtual bool isBufferBound(unsigned short index) const
Gets whether a buffer is bound to the given source index.
Ogre::VET_FLOAT3
@ VET_FLOAT3
Definition: OgreHardwareVertexBuffer.h:127
Ogre::VertexDeclaration::removeAllElements
virtual void removeAllElements(void)
Remove all elements.
Ogre::VET_SHORT2
@ VET_SHORT2
Definition: OgreHardwareVertexBuffer.h:132
Ogre::VertexDeclaration::mElementList
VertexElementList mElementList
Definition: OgreHardwareVertexBuffer.h:345
OgreHardwareBuffer.h
Ogre::VertexDeclaration::findElementsBySource
virtual VertexElementList findElementsBySource(unsigned short source) const
Based on the current elements, gets the size of the vertex for a given buffer source.
Ogre::VET_INT4
@ VET_INT4
Definition: OgreHardwareVertexBuffer.h:151
Ogre::VES_SPECULAR
@ VES_SPECULAR
Specular colours.
Definition: OgreHardwareVertexBuffer.h:111
Ogre::VET_SHORT1
@ VET_SHORT1
Definition: OgreHardwareVertexBuffer.h:131
Ogre::operator==
bool operator==(STLAllocator< T, P > const &, STLAllocator< T2, P > const &)
determine equality, can memory from another allocator be released by this allocator,...
Definition: OgreMemorySTLAllocator.h:184
Ogre::VES_BLEND_WEIGHTS
@ VES_BLEND_WEIGHTS
Blending weights.
Definition: OgreHardwareVertexBuffer.h:103
Ogre::VET_USHORT1
@ VET_USHORT1
Definition: OgreHardwareVertexBuffer.h:144
Ogre::HardwareVertexBuffer::getManager
HardwareBufferManagerBase * getManager() const
Return the manager of this buffer, if any.
Definition: OgreHardwareVertexBuffer.h:66
Ogre::VertexDeclaration::removeElement
virtual void removeElement(VertexElementSemantic semantic, unsigned short index=0)
Remove the element with the given semantic and usage index.
Ogre::HardwareVertexBuffer::mIsInstanceData
bool mIsInstanceData
Definition: OgreHardwareVertexBuffer.h:55
Ogre::HardwareVertexBuffer::mInstanceDataStepRate
size_t mInstanceDataStepRate
Definition: OgreHardwareVertexBuffer.h:56
Ogre::HardwareBufferLockGuard
Locking helper.
Definition: OgreHardwareBuffer.h:358
Ogre::VET_UINT2
@ VET_UINT2
Definition: OgreHardwareVertexBuffer.h:153
Ogre::VertexDeclaration::sort
void sort(void)
Sorts the elements in this list to be compatible with the maximum number of rendering APIs / graphics...
Ogre::VertexBufferBinding::hasInstanceData
virtual bool hasInstanceData() const
Returns true if this binding has an element that contains instance data.
Ogre::VertexDeclaration::getElements
const VertexElementList & getElements(void) const
Gets read-only access to the list of vertex elements.
Ogre::VertexBufferBinding::BindingIndexMap
map< ushort, ushort >::type BindingIndexMap
Definition: OgreHardwareVertexBuffer.h:569
Ogre::VET_FLOAT4
@ VET_FLOAT4
Definition: OgreHardwareVertexBuffer.h:128
Ogre::HardwareVertexBuffer::getNumVertices
size_t getNumVertices(void) const
Get the number of vertices in this buffer.
Definition: OgreHardwareVertexBuffer.h:70
Ogre::VES_POSITION
@ VES_POSITION
Position, 3 reals per vertex.
Definition: OgreHardwareVertexBuffer.h:101

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.