]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/modulecache.h
Redesign loading of GLSL sources
[libs/gl.git] / source / glsl / modulecache.h
diff --git a/source/glsl/modulecache.h b/source/glsl/modulecache.h
new file mode 100644 (file)
index 0000000..ba892f9
--- /dev/null
@@ -0,0 +1,33 @@
+#ifndef MSP_GL_SL_MODULECACHE_H_
+#define MSP_GL_SL_MODULECACHE_H_
+
+#include <msp/datafile/collection.h>
+#include "syntax.h"
+
+namespace Msp {
+namespace GL {
+namespace SL {
+
+class ModuleCache
+{
+private:
+       DataFile::Collection *resources;
+       std::map<std::string, Module *> modules;
+       unsigned next_source;
+
+public:
+       ModuleCache(DataFile::Collection *);
+       ModuleCache(const ModuleCache &);
+       ModuleCache &operator=(const ModuleCache &);
+       ~ModuleCache();
+
+       const Module &add_module(const std::string &, const std::string &);
+       const Module &add_module(IO::Base &, const std::string &);
+       const Module &get_module(const std::string &);
+};
+
+} // namespace SL
+} // namespace GL
+} // namespace Msp
+
+#endif