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 &);
50 std::string create_flags() const;
63 std::list<Shader *> shaders;
64 std::list<Shader *> owned_data;
66 std::map<std::string, UniformInfo> uniforms;
70 Program(const StandardFeatures &);
71 Program(const std::string &, const std::string &);
77 void attach_shader(Shader &shader);
78 void attach_shader_owned(Shader *shader);
79 void detach_shader(Shader &shader);
80 void add_standard_shaders(const StandardFeatures &);
82 static std::string process_standard_source(const char **, const std::string &);
84 const std::list<Shader *> &get_shaders() const { return shaders; }
85 void bind_attribute(unsigned, const std::string &);
87 bool is_linked() const { return linked; }
88 std::string get_info_log() const;
90 int get_uniform_location(const std::string &) const;