1 #ifndef MSP_GL_PROGRAM_H_
2 #define MSP_GL_PROGRAM_H_
6 #include <msp/datafile/objectloader.h>
15 class Program: public Bindable<Program>
18 class Loader: public DataFile::ObjectLoader<Program>
24 virtual void finish();
26 void attribute(unsigned, const std::string &);
27 void fragment_shader(const std::string &);
29 void vertex_shader(const std::string &);
32 struct StandardFeatures
34 class Loader: public DataFile::ObjectLoader<StandardFeatures>
37 Loader(StandardFeatures &);
51 std::string create_flags() const;
62 typedef std::list<Shader *> ShaderList;
63 typedef std::map<std::string, UniformInfo> UniformMap;
68 ShaderList owned_data;
71 unsigned uniform_layout_hash;
75 Program(const StandardFeatures &);
76 Program(const std::string &, const std::string &);
82 void attach_shader(Shader &shader);
83 void attach_shader_owned(Shader *shader);
84 void detach_shader(Shader &shader);
85 void add_standard_shaders(const StandardFeatures &);
87 static std::string process_standard_source(const char **, const std::string &);
89 const ShaderList &get_shaders() const { return shaders; }
91 void bind_attribute(unsigned, const std::string &);
94 bool is_linked() const { return linked; }
95 std::string get_info_log() const;
97 unsigned get_uniform_layout_hash() const { return uniform_layout_hash; }
98 int get_uniform_location(const std::string &) const;
101 static void unbind();