- program.attach_shader_owned(new VertexShader(apply<Formatter>(*i)));
- for(map<string, unsigned>::iterator j=i->locations.begin(); j!=i->locations.end(); ++j)
- program.bind_attribute(j->second, j->first);
+ if(i->type==VERTEX)
+ {
+ program.attach_shader_owned(new VertexShader(apply<Formatter>(*i)));
+ for(map<string, unsigned>::iterator j=i->locations.begin(); j!=i->locations.end(); ++j)
+ program.bind_attribute(j->second, j->first);
+ }
+ else if(i->type==GEOMETRY)
+ program.attach_shader_owned(new GeometryShader(apply<Formatter>(*i)));
+ else if(i->type==FRAGMENT)
+ {
+ program.attach_shader_owned(new FragmentShader(apply<Formatter>(*i)));
+ if(EXT_gpu_shader4)
+ {
+ for(map<string, unsigned>::iterator j=i->locations.begin(); j!=i->locations.end(); ++j)
+ program.bind_fragment_data(j->second, j->first);
+ }
+ }