From: Mikko Rasa Date: Sun, 15 Dec 2013 23:05:29 +0000 (+0200) Subject: Add interface for glBindFragDataLocation, required for modern shaders X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=2579be0c3bf50f060364b937e6b2446ea3547e4b;p=libs%2Fgl.git Add interface for glBindFragDataLocation, required for modern shaders --- diff --git a/extensions/ext_gpu_shader4.glext b/extensions/ext_gpu_shader4.glext new file mode 100644 index 00000000..54d1360e --- /dev/null +++ b/extensions/ext_gpu_shader4.glext @@ -0,0 +1 @@ +extension EXT_gpu_shader4 diff --git a/source/program.cpp b/source/program.cpp index c8ce67a8..9c95ee17 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,12 @@ void Program::bind_attribute(unsigned index, const string &name) glBindAttribLocation(id, index, name.c_str()); } +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) diff --git a/source/program.h b/source/program.h index a7622ecb..642bcf5e 100644 --- a/source/program.h +++ b/source/program.h @@ -81,6 +81,7 @@ public: const ShaderList &get_shaders() const { return shaders; } void bind_attribute(unsigned, const std::string &); + void bind_fragment_data(unsigned, const std::string &); void link(); private: