X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fprogram.cpp;h=50ebed22899d57fae6d21518fdce048084b7062b;hb=749e72344ba72c5654306178617f08cdb0ee03cd;hp=c8ce67a8897fc6fd5499b251e4a7713b71ff496e;hpb=6924ea10c4111b11eab51f0e1aa5b4a6438da7d3;p=libs%2Fgl.git diff --git a/source/program.cpp b/source/program.cpp index c8ce67a8..50ebed22 100644 --- a/source/program.cpp +++ b/source/program.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include "buffer.h" #include "error.h" @@ -88,6 +89,17 @@ void Program::bind_attribute(unsigned index, const string &name) glBindAttribLocation(id, index, name.c_str()); } +void Program::bind_attribute(VertexComponent comp, const string &name) +{ + bind_attribute(get_component_type(comp), name); +} + +void Program::bind_fragment_data(unsigned index, const string &name) +{ + static Require _req(EXT_gpu_shader4); + glBindFragDataLocation(id, index, name.c_str()); +} + void Program::link() { for(ShaderList::iterator i=shaders.begin(); i!=shaders.end(); ++i)