From: Mikko Rasa Date: Sun, 7 Nov 2021 09:04:36 +0000 (+0200) Subject: Hide the allow_gl_calls member of Mesh::Loader X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=5fa69268fa051ce8d74d30bb3d7eecc1b00cff15;p=libs%2Fgl.git Hide the allow_gl_calls member of Mesh::Loader --- diff --git a/source/core/mesh.cpp b/source/core/mesh.cpp index 467f3544..b5628eb1 100644 --- a/source/core/mesh.cpp +++ b/source/core/mesh.cpp @@ -243,9 +243,8 @@ void Mesh::set_debug_name(const string &name) } -Mesh::Loader::Loader(Mesh &m, bool g): - DataFile::ObjectLoader(m), - allow_gl_calls(g) +Mesh::Loader::Loader(Mesh &m): + DataFile::ObjectLoader(m) { add("batch", &Loader::batch); add("storage", &Loader::storage); @@ -312,7 +311,8 @@ bool Mesh::AsyncLoader::process() { // TODO use correct filename DataFile::Parser parser(io, "async"); - Loader loader(mesh, false); + Loader loader(mesh); + loader.allow_gl_calls = false; loader.load(parser); } else if(phase==1) diff --git a/source/core/mesh.h b/source/core/mesh.h index 98a028db..f8e1b6c1 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();