#include "buffer.h"
#include "mesh.h"
-#include "nv_primitive_restart.h"
#include "renderer.h"
using namespace std;
void Mesh::add_batch(const Batch &b)
{
- bool can_append = false;
- if(!batches.empty())
- {
- PrimitiveType type = b.get_type();
- can_append = (type==batches.back().get_type() &&
- type!=LINE_STRIP && type!=LINE_LOOP && type!=POLYGON &&
- (type!=TRIANGLE_FAN || NV_primitive_restart));
- }
-
if(defer_ibuf)
{
ibuf = new Buffer(ELEMENT_ARRAY_BUFFER);
defer_ibuf = false;
}
- if(can_append)
+ if(!batches.empty() && batches.back().can_append(b.get_type()))
batches.back().append(b);
else
{