Program::~Program()
{
- for(list<Shader *>::iterator i=owned_data.begin(); i!=owned_data.end(); ++i)
+ for(ShaderList::iterator i=owned_data.begin(); i!=owned_data.end(); ++i)
delete *i;
glDeleteObjectARB(id);
}
void Program::detach_shader(Shader &shader)
{
- list<Shader *>::iterator i = remove(shaders.begin(), shaders.end(), &shader);
+ ShaderList::iterator i = remove(shaders.begin(), shaders.end(), &shader);
if(i!=shaders.end())
{
shaders.erase(i, shaders.end());
void Program::link()
{
- for(list<Shader *>::iterator i=shaders.begin(); i!=shaders.end(); ++i)
+ for(ShaderList::iterator i=shaders.begin(); i!=shaders.end(); ++i)
if(!(*i)->is_compiled())
(*i)->compile();
int Program::get_uniform_location(const string &n) const
{
- map<string, UniformInfo>::const_iterator i = uniforms.find(n);
+ UniformMap::const_iterator i = uniforms.find(n);
if(i==uniforms.end())
{
if(n[n.size()-1]==']')
GLenum type;
};
+ typedef std::list<Shader *> ShaderList;
+ typedef std::map<std::string, UniformInfo> UniformMap;
+
private:
unsigned id;
- std::list<Shader *> shaders;
- std::list<Shader *> owned_data;
+ ShaderList shaders;
+ ShaderList owned_data;
bool linked;
- std::map<std::string, UniformInfo> uniforms;
+ UniformMap uniforms;
unsigned uniform_layout_hash;
public:
private:
static std::string process_standard_source(const char **, const std::string &);
public:
- const std::list<Shader *> &get_shaders() const { return shaders; }
+ const ShaderList &get_shaders() const { return shaders; }
void bind_attribute(unsigned, const std::string &);
void link();
bool is_linked() const { return linked; }