class Mesh: public Resource
{
friend class MeshBuilder;
+ class AsyncLoader;
public:
class Loader: public DataFile::ObjectLoader<Mesh>
{
+ friend class AsyncLoader;
+
private:
- bool allow_gl_calls;
+ bool allow_gl_calls = true;
public:
- Loader(Mesh &, bool = true);
+ Loader(Mesh &);
private:
void storage(const std::vector<VertexAttribute> &);
void vertices();
private:
Mesh &mesh;
IO::Seekable &io;
- Bufferable::AsyncUpdater *vertex_updater;
- Bufferable::AsyncUpdater *index_updater;
- unsigned phase;
+ Bufferable::AsyncUpdater *vertex_updater = 0;
+ Bufferable::AsyncUpdater *index_updater = 0;
+ unsigned phase = 0;
public:
AsyncLoader(Mesh &, IO::Seekable &);
public:
Mesh() = default;
Mesh(const VertexFormat &);
+ Mesh(Mesh &&);
~Mesh();
/** Sets the vertex format for the mesh. It cannot be changed once set. */
/** Adds a batch to the mesh. It may be combined with the last existing
batch if the primitive types are compatible. */
- void add_batch(const Batch &b);
+ void add_batch(Batch &&b);
const std::vector<Batch> &get_batches() const { return batches; }