Add proper support for IndexType and uint32 indices

This commit is contained in:
SirLynix
2022-04-04 09:02:00 +02:00
parent 66ff6cfa81
commit 9d526741b9
34 changed files with 188 additions and 57 deletions

View File

@@ -120,6 +120,19 @@ namespace Nz
return {};
}
inline GLenum ToOpenGL(IndexType indexType)
{
switch (indexType)
{
case IndexType::U8: return GL_UNSIGNED_BYTE;
case IndexType::U16: return GL_UNSIGNED_SHORT;
case IndexType::U32: return GL_UNSIGNED_INT;
}
NazaraError("Unhandled IndexType 0x" + NumberToString(UnderlyingCast(indexType), 16));
return {};
}
inline GLenum ToOpenGL(PrimitiveMode primitiveMode)
{
switch (primitiveMode)