+GL::Module *Resources::create_module(const string &name)
+{
+ if(name!="ui.glsl")
+ return nullptr;
+
+ GL::Module *mod = nullptr;
+ if(GL::get_backend_api()==GL::VULKAN)
+ mod = new GL::SpirVModule;
+ else
+ mod = new GL::GlslModule;
+
+ mod->set_source("import msp_interface; import common;\n"
+ "uniform sampler2D ui_tex;\n"
+ "#pragma MSP stage(fragment)\n"
+ "void main() { frag_color = texture(ui_tex, texcoord.xy)*color; }\n");
+
+ return mod;
+}
+
+GL::Program *Resources::create_program(const string &name)
+{
+ if(name!="ui.shader")
+ return nullptr;
+
+ return new GL::Program(get<GL::Module>("ui.glsl"));
+}
+
+GL::Sampler *Resources::create_sampler(const string &name)
+{
+ static const Regex r_name("^(linear|nearest)_clamp.samp$");
+ if(RegMatch m = r_name.match(name))
+ {
+ GL::Sampler *sampler = new GL::Sampler;
+ sampler->set_filter(lexical_cast<GL::TextureFilter>(toupper(m.group(1).str)));
+ sampler->set_wrap(GL::CLAMP_TO_EDGE);
+ return sampler;
+ }
+
+ return nullptr;
+}
+