-----------------------------------------------------------------------------------
| 89 | } |
| 90 | //----------------------------------------------------------------------------------- |
| 91 | void VertexArrayObject::setPrimitiveRange( uint32 primStart, uint32 primCount ) |
| 92 | { |
| 93 | size_t limit; |
| 94 | if( mIndexBuffer ) |
| 95 | limit = mIndexBuffer->getNumElements(); |
| 96 | else |
| 97 | { |
| 98 | if( !mVertexBuffers.empty() ) |
| 99 | limit = mVertexBuffers[0]->getNumElements(); |
| 100 | else |
| 101 | limit = std::numeric_limits<uint32>::max(); |
| 102 | } |
| 103 | |
| 104 | if( primStart > limit ) |
| 105 | { |
| 106 | OGRE_EXCEPT( Exception::ERR_INVALIDPARAMS, |
| 107 | "primStart must be less or equal than " + StringConverter::toString( limit ), |
| 108 | "VertexArrayObject::setPrimitiveRange" ); |
| 109 | } |
| 110 | |
| 111 | if( primStart + primCount > limit ) |
| 112 | { |
| 113 | OGRE_EXCEPT( |
| 114 | Exception::ERR_INVALIDPARAMS, |
| 115 | "primStart + primCount must be less or equal than " + StringConverter::toString( limit ), |
| 116 | "VertexArrayObject::setPrimitiveRange" ); |
| 117 | } |
| 118 | |
| 119 | mPrimStart = primStart; |
| 120 | mPrimCount = primCount; |
| 121 | } |
| 122 | //----------------------------------------------------------------------------------- |
| 123 | const VertexElement2 *VertexArrayObject::findBySemantic( VertexElementSemantic semantic, |
| 124 | size_t &outIndex, size_t &outOffset, |
no test coverage detected