MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / AcquireIndexPointer

Method AcquireIndexPointer

Sources/nCine/Graphics/Geometry.cpp:125–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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()

Callers 2

DrawMethod · 0.80
CollectCommandsMethod · 0.80

Calls 4

DEATH_ASSERTFunction · 0.85
MapBufferRangeMethod · 0.80
AcquireMemoryMethod · 0.45
GetSizeMethod · 0.45

Tested by

no test coverage detected