From 2579be0c3bf50f060364b937e6b2446ea3547e4b Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 16 Dec 2013 01:05:29 +0200 Subject: [PATCH] Add interface for glBindFragDataLocation, required for modern shaders --- extensions/ext_gpu_shader4.glext | 1 + source/program.cpp | 7 +++++++ source/program.h | 1 + 3 files changed, 9 insertions(+) create mode 100644 extensions/ext_gpu_shader4.glext 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: -- 2.45.2