X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fcore%2Fmesh.h;h=ba2aebc76c1fd35254f66429f5035e4370d587b5;hp=5544ed1f55e0e5cdf772cf9194d26bc9eabbd775;hb=HEAD;hpb=190a7e11237351f6b730c28f7b16f183e8adc69c diff --git a/source/core/mesh.h b/source/core/mesh.h index 5544ed1f..ba2aebc7 100644 --- a/source/core/mesh.h +++ b/source/core/mesh.h @@ -27,15 +27,18 @@ a Technique and is usually the appropriate way to of rendering geometry. class Mesh: public Resource { friend class MeshBuilder; + class AsyncLoader; public: class Loader: public DataFile::ObjectLoader { + 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 &); void vertices(); @@ -49,9 +52,9 @@ private: 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 &); @@ -80,6 +83,7 @@ private: public: Mesh() = default; Mesh(const VertexFormat &); + Mesh(Mesh &&); ~Mesh(); /** Sets the vertex format for the mesh. It cannot be changed once set. */ @@ -102,7 +106,7 @@ public: /** 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 &get_batches() const { return batches; }