vbuf = 0;
ibuf = 0;
vtx_setup = 0;
- defer_buffers = ARB_vertex_buffer_object;
disallow_rendering = false;
winding = 0;
batches.clear();
}
-void Mesh::use_buffers(bool b)
-{
- defer_buffers = false;
- if(b)
- create_buffers();
- else
- {
- vertices.use_buffer(0);
- delete vbuf;
- vbuf = 0;
- delete ibuf;
- ibuf = 0;
- }
-}
-
void Mesh::create_buffers()
{
- defer_buffers = false;
-
if(!vbuf)
vbuf = new Buffer(ARRAY_BUFFER);
vertices.use_buffer(vbuf);
void Mesh::add_batch(const Batch &b)
{
- if(defer_buffers)
- create_buffers();
+ create_buffers();
if(!batches.empty() && batches.back().can_append(b.get_type()))
batches.back().append(b);
batches.clear();
delete vbuf;
delete ibuf;
- defer_buffers = (vbuf || ibuf);
vbuf = 0;
ibuf = 0;
}
phase(0)
{
mesh.disallow_rendering = true;
- if(mesh.defer_buffers)
- mesh.create_buffers();
+ mesh.create_buffers();
}
Mesh::AsyncLoader::~AsyncLoader()