im creating a meshbuffer now i noticed that you can choose between a 16 bit and a 32 bit index type. i currently have a count of the vertices i want to load into a buffer, but i would like to eliminate this step. This is how i determine which type to use now:
if (m_nVertices <= 65536)
m_pMeshBuffer = new irr::scene::CDynamicMeshBuffer(irr::video::EVT_STANDARD, irr::video::EIT_16BIT);
else
m_pMeshBuffer = new irr::scene::CDynamicMeshBuffer(irr::video::EVT_STANDARD, irr::video::EIT_32BIT);
Is there a way to change the index type from 16 to 32 bit when needed? Or is there a better way of doing this?
So either you count the vertices you want to add and create the type you need OR you create the 32 bit by default. which could lead to using more memory than is absolutely needed.