| 123 | } |
| 124 | |
| 125 | GLushort* Geometry::AcquireIndexPointer(std::uint32_t numIndices) |
| 126 | { |
| 127 | DEATH_ASSERT(ibo_ == nullptr); |
| 128 | hasDirtyIndices_ = true; |
| 129 | |
| 130 | if (sharedIboParams_ != nullptr) { |
| 131 | iboParams_ = *sharedIboParams_; |
| 132 | } else { |
| 133 | const RenderBuffersManager::BufferTypes bufferType = RenderBuffersManager::BufferTypes::ElementArray; |
| 134 | if (iboParams_.mapBase == nullptr) { |
| 135 | iboParams_ = RenderResources::GetBuffersManager().AcquireMemory(bufferType, numIndices * sizeof(GLushort)); |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | return reinterpret_cast<GLushort*>(iboParams_.mapBase + iboParams_.offset); |
| 140 | } |
| 141 | |
| 142 | /*! This method can only be used when mapping of OpenGL buffers is available */ |
| 143 | GLushort* Geometry::AcquireIndexPointer() |
no test coverage detected