In other words, if a mod or admin stumbles upon this please do close or delete this as it's no longer relevant.
Okay, so I have a dynamic mesh generating class in a separate file (as it, and the classes it depend on are pretty damn large) and due to working with very large vertex counts I'd like to use VBOs to speed things up.
However I am not quite sure how I would do this.
Code: Select all
scene::SMesh *mesh = new scene::SMesh();
for (u32 i=0; i<6; ++i)
{
scene::IMeshBuffer *buf = new scene::SMeshBuffer();
buf->append(vertices + 4 * i, 4, indices, 6);
buf->getMaterial().setFlag(video::EMF_LIGHTING, false);
buf->getMaterial().setFlag(video::EMF_BILINEAR_FILTER, false);
buf->getMaterial().MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF;
mesh->addMeshBuffer(buf);
buf->drop();
}
scene::SAnimatedMesh *aMesh = new scene::SAnimatedMesh(mesh);
mesh->drop();
scaleMesh(aMesh, scale);
aMesh->getMeshBuffer(0)->setHardwareMappingHint(scene::EHM_DYNAMIC);
aMesh->setDirty();
Perhaps a better solution is to make the function of type SAnimatedMesh and then return aMesh, then clearing it and then allocating the VBOs in the main thread?
I'm not sure if that'd be bad practice, in fact that sounds just as bad to me.