18 mNumPrimitives(numPrimitives),
19 mNumActivePrimitives(numPrimitives),
46 LogWarning(
"Invalid number of active primitives.");
65 LogError(
"Invalid first primitive.");
87 uint32_t*
index = i + Get<uint32_t>();
92 uint16_t*
index = i + Get<uint16_t>();
93 *index =
static_cast<uint16_t
>(
v);
109 uint32_t
const*
index = i + Get<uint32_t>();
114 uint16_t
const*
index = i + Get<uint16_t>();
115 v =
static_cast<uint32_t
>(*index);
133 uint32_t*
index = 2 * i + Get<uint32_t>();
139 uint32_t*
index = i + Get<uint32_t>();
148 uint16_t*
index = 2 * i + Get<uint16_t>();
149 *index++ =
static_cast<uint16_t
>(
v0);
150 *index =
static_cast<uint16_t
>(
v1);
154 uint16_t*
index = i + Get<uint16_t>();
155 *index++ =
static_cast<uint16_t
>(
v0);
156 *index =
static_cast<uint16_t
>(
v1);
175 uint32_t
const*
index = 2 * i + Get<uint32_t>();
181 uint32_t
const*
index = i + Get<uint32_t>();
190 uint16_t
const*
index = 2 * i + Get<uint16_t>();
191 v0 =
static_cast<uint32_t
>(*index++);
192 v1 =
static_cast<uint32_t
>(*index);
196 uint16_t
const*
index = i + Get<uint16_t>();
197 v0 =
static_cast<uint32_t
>(*index++);
198 v1 =
static_cast<uint32_t
>(*index);
217 uint32_t*
index = 3 * i + Get<uint32_t>();
224 uint32_t*
index = i + Get<uint32_t>();
242 uint16_t*
index = 3 * i + Get<uint16_t>();
243 *index++ =
static_cast<uint16_t
>(
v0);
244 *index++ =
static_cast<uint16_t
>(
v1);
245 *index =
static_cast<uint16_t
>(
v2);
249 uint16_t*
index = i + Get<uint16_t>();
250 index[0] =
static_cast<uint16_t
>(
v0);
253 index[2] =
static_cast<uint16_t
>(
v1);
254 index[1] =
static_cast<uint16_t
>(
v2);
258 index[1] =
static_cast<uint16_t
>(
v1);
259 index[2] =
static_cast<uint16_t
>(
v2);
279 uint32_t
const*
index = 3 * i + Get<uint32_t>();
286 uint32_t
const*
index = i + Get<uint32_t>();
287 uint32_t
offset = (i & 1);
297 uint16_t
const*
index =
298 3 * i + Get<uint16_t>();
299 v0 =
static_cast<uint32_t
>(*index++);
300 v1 =
static_cast<uint32_t
>(*index++);
301 v2 =
static_cast<uint32_t
>(*index);
305 uint16_t
const*
index = i + Get<uint16_t>();
307 v0 =
static_cast<uint32_t
>(index[0]);
308 v1 =
static_cast<uint32_t
>(index[1 +
offset]);
309 v2 =
static_cast<uint32_t
>(index[2 -
offset]);
321 return numPrimitives > 0 ? numPrimitives : 1;
325 uint32_t numPrimitives)
328 return numPrimitives > 0 ? 2 * numPrimitives : 2;
332 uint32_t numPrimitives)
335 return numPrimitives > 0 ? numPrimitives + 1 : 2;
341 return numPrimitives > 0 ? 3 * numPrimitives : 3;
347 return numPrimitives > 0 ? numPrimitives + 2 : 3;
353 return numPrimitives > 0 ? 4 * numPrimitives : 4;
359 return numPrimitives > 0 ? numPrimitives + 3 : 4;
365 return numPrimitives > 0 ? 6 * numPrimitives : 6;
371 return numPrimitives > 0 ? 2 * (numPrimitives + 2) : 6;
static uint32_t GetPolysegmentContiguousAdjIndexCount(uint32_t numPrimitives)
static ICFunction msIndexCounter[IP_NUM_TYPES]
static uint32_t GetPolysegmentDisjointAdjIndexCount(uint32_t numPrimitives)
bool SetSegment(uint32_t i, uint32_t v0, uint32_t v1)
bool SetTriangle(uint32_t i, uint32_t v0, uint32_t v1, uint32_t v2)
#define LogAssert(condition, message)
static uint32_t GetPolysegmentContiguousIndexCount(uint32_t numPrimitives)
static uint32_t GetTrimeshIndexCount(uint32_t numPrimitives)
uint32_t(* ICFunction)(uint32_t)
void SetFirstPrimitive(uint32_t first)
static uint32_t GetTrimeshAdjIndexCount(uint32_t numPrimitives)
static uint32_t GetTristripIndexCount(uint32_t numPrimitives)
bool GetSegment(uint32_t i, uint32_t &v0, uint32_t &v1) const
uint32_t GetFirstIndex() const
unsigned int mElementSize
#define LogError(message)
static uint32_t GetTristripAdjIndexCount(uint32_t numPrimitives)
bool ValidPrimitiveType(IPType type) const
void SetNumActivePrimitives(uint32_t numActive)
#define LogWarning(message)
bool GetPoint(uint32_t i, uint32_t &v) const
static uint32_t GetPolypointIndexCount(uint32_t numPrimitives)
bool SetPoint(uint32_t i, uint32_t v)
GTE_IMPEXP uint32_t Log2OfPowerOfTwo(uint32_t powerOfTwo)
GLfloat GLfloat GLfloat v2
bool GetTriangle(uint32_t i, uint32_t &v0, uint32_t &v1, uint32_t &v2) const
uint32_t mNumActivePrimitives
GLint GLint GLsizei GLint GLenum GLenum type
IndexBuffer(IPType type, uint32_t numPrimitives, size_t indexSize, bool createStorage=true)
static uint32_t GetPolysegmentDisjointIndexCount(uint32_t numPrimitives)
uint32_t GetNumActiveIndices() const