3 This file is part of libmspgl
4 Copyright © 2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #ifndef MSP_GL_PROGRAM_H_
9 #define MSP_GL_PROGRAM_H_
13 #include <msp/datafile/objectloader.h>
22 class Program: public Bindable<Program>
25 class Loader: public DataFile::ObjectLoader<Program>
31 virtual void finish();
33 void attribute(unsigned, const std::string &);
34 void fragment_shader(const std::string &);
36 void vertex_shader(const std::string &);
39 struct StandardFeatures
41 class Loader: public DataFile::ObjectLoader<StandardFeatures>
44 Loader(StandardFeatures &);
56 std::string create_flags() const;
61 std::list<Shader *> shaders;
67 Program(const StandardFeatures &);
68 Program(const std::string &, const std::string &);
74 void attach_shader(Shader &shader);
75 void detach_shader(Shader &shader);
76 void add_standard_shaders(const StandardFeatures &);
78 static std::string process_standard_source(const char **, const std::string &);
80 const std::list<Shader *> &get_shaders() const { return shaders; }
81 void set_del_shaders(bool);
82 void bind_attribute(unsigned, const std::string &);
84 int get_param(GLenum param) const;
85 bool get_linked() const { return linked; }
86 std::string get_info_log() const;
88 int get_uniform_location(const std::string &) const;