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);
#include "bindable.h"
#include "gl.h"
#include "programbuilder.h"
+#include "vertexformat.h"
namespace Msp {
namespace GL {
const ShaderList &get_shaders() const { return shaders; }
void bind_attribute(unsigned, const std::string &);
+ void bind_attribute(VertexComponent, const std::string &);
void bind_fragment_data(unsigned, const std::string &);
void link();
if(!features.legacy)
{
prog.bind_fragment_data(0, "frag_color");
- prog.bind_attribute(get_component_type(VERTEX4), "vertex");
+ prog.bind_attribute(VERTEX4, "vertex");
if(features.lighting)
- prog.bind_attribute(get_component_type(NORMAL3), "normal");
+ prog.bind_attribute(NORMAL3, "normal");
else if(features.material)
- prog.bind_attribute(get_component_type(COLOR4_FLOAT), "color");
+ prog.bind_attribute(COLOR4_FLOAT, "color");
if(features.texture || features.normalmap)
- prog.bind_attribute(get_component_type(TEXCOORD4), "texcoord");
+ prog.bind_attribute(TEXCOORD4, "texcoord");
}
if(features.normalmap)
{