index_type = t;
BatchBackend::set_index_type(t);
update_offset();
- dirty = true;
+ mark_dirty();
+}
+
+void Batch::set_patch_size(unsigned s)
+{
+ if(prim_type!=PATCHES)
+ throw invalid_operation("Batch::set_patch_size");
+ if(s<1)
+ throw invalid_argument("Batch::set_patch_size");
+
+ patch_size = s;
}
Batch &Batch::append(unsigned i)
append_index(i);
update_offset();
- dirty = true;
+ mark_dirty();
return *this;
}
append_index(i);
update_offset();
- dirty = true;
+ mark_dirty();
return *this;
}
append_index(other.get_index(i));
update_offset();
- dirty = true;
+ mark_dirty();
return *this;
}
::append<uint16_t>(data, i);
}
-size_t Batch::get_index_size() const
-{
- return (index_type==UNSIGNED_INT ? sizeof(uint32_t) : sizeof(uint16_t));
-}
-
unsigned Batch::get_index(size_t i) const
{
if(index_type==UNSIGNED_INT)
DataFile::ObjectLoader<Batch>(b)
{
add("indices", &Loader::indices);
+ add("patch_size", &Loader::patch_size);
}
void Batch::Loader::indices(const vector<unsigned> &ind)
obj.append(ind);
}
+void Batch::Loader::patch_size(unsigned s)
+{
+ obj.set_patch_size(s);
+}
+
} // namespace GL
} // namespace Msp