Not sure if this is a bug or not. I was playing with the terraindemo from zenprogramming and was getting Could not draw triangles, too many vertices error.
I checked in the debugger and found that the vtxCount is 65536 and getMaximalPrimitiveCount is 65535
changing
if (vtxCount > m)
to
if ((vtxCount-1) > m)
fixes the issue and the water height renders correctly also.
line 716 in CVideoNull.cpp
bool CVideoNull::checkPrimitiveCount(s32 vtxCount)
{
s32 m = getMaximalPrimitiveCount();
if (vtxCount > m)
{
char tmp[1024];
sprintf(tmp,"Could not draw triangles, too many vertices(%d), maxium is %d.", vtxCount, m);
os::Printer::log(tmp, ELL_ERROR);
return false;
}
return true;
}
I got this error on My ATI 9600 using EDT_OPENGL and EDT_DIRECTX8 in createDevice but not EDT_DIRECTX9
on my Nvidia machine it happens in all modes.
kinda new at this so if someone can confirm that would be great