X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fmodule.h;h=78afcfc9823997161644c1d51e4eb5830a1c008f;hb=c93e0613e96ec6817e26b533e90dc49d45787941;hp=b1c0f8abebda67ac56742507277bae9ccb92af22;hpb=dccad64b2ec82249d850b9745614042171499972;p=libs%2Fgl.git diff --git a/source/core/module.h b/source/core/module.h index b1c0f8ab..78afcfc9 100644 --- a/source/core/module.h +++ b/source/core/module.h @@ -3,6 +3,7 @@ #include #include +#include "glsl/compiler.h" #include "glsl/sourcemap.h" namespace Msp { @@ -12,17 +13,39 @@ class Resources; class Module { -private: - std::string prepared_source; - SL::SourceMap source_map; +public: + enum Format + { + GLSL, + }; +protected: + Module() { } public: - Module(); + virtual ~Module() { } + + virtual Format get_format() const = 0; void set_source(const std::string &); void load_source(IO::Base &, Resources *, const std::string &); void load_source(IO::Base &, const std::string &); +private: + virtual void compile(SL::Compiler &) = 0; +}; +class GlslModule: public Module +{ +private: + std::string prepared_source; + SL::SourceMap source_map; + +public: + virtual Format get_format() const { return GLSL; } + +private: + virtual void compile(SL::Compiler &); + +public: const std::string &get_prepared_source() const { return prepared_source; } const SL::SourceMap &get_source_map() const { return source_map; } };