]> git.tdb.fi Git - libs/gl.git/commitdiff
Hide the allow_gl_calls member of Mesh::Loader
authorMikko Rasa <tdb@tdb.fi>
Sun, 7 Nov 2021 09:04:36 +0000 (11:04 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 7 Nov 2021 09:04:36 +0000 (11:04 +0200)
source/core/mesh.cpp
source/core/mesh.h

index 467f35448382e4d02744cbc3a6ccf36fef657984..b5628eb10c860bbc758b17e08b7db045bea7b65c 100644 (file)
@@ -243,9 +243,8 @@ void Mesh::set_debug_name(const string &name)
 }
 
 
-Mesh::Loader::Loader(Mesh &m, bool g):
-       DataFile::ObjectLoader<Mesh>(m),
-       allow_gl_calls(g)
+Mesh::Loader::Loader(Mesh &m):
+       DataFile::ObjectLoader<Mesh>(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)
index 98a028dbc88ea8f231c039ce97dcc48834e3c347..f8e1b6c1fa20f2148e582976b817109ca8e4f86c 100644 (file)
@@ -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<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();