summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/shaders.cc
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/utils/asymptote/shaders.cc')
-rw-r--r--Build/source/utils/asymptote/shaders.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/Build/source/utils/asymptote/shaders.cc b/Build/source/utils/asymptote/shaders.cc
index 877458acaae..ab0c194917f 100644
--- a/Build/source/utils/asymptote/shaders.cc
+++ b/Build/source/utils/asymptote/shaders.cc
@@ -17,25 +17,31 @@ GLuint compileAndLinkShader(std::vector<ShaderfileModePair> const& shaders,
size_t Nlights, size_t NMaterials,
std::vector<std::string> const& defineflags)
{
- GLuint mainShader = glCreateProgram();
+ GLuint shader = glCreateProgram();
std::vector<GLuint> compiledShaders;
size_t n=shaders.size();
for(size_t i=0; i < n; ++i) {
GLint newshader=createShaderFile(shaders[i].first,shaders[i].second,
Nlights,NMaterials,defineflags);
- glAttachShader(mainShader,newshader);
+ glAttachShader(shader,newshader);
compiledShaders.push_back(newshader);
}
- glLinkProgram(mainShader);
+ glBindAttribLocation(shader,positionAttrib,"position");
+ glBindAttribLocation(shader,normalAttrib,"normal");
+ glBindAttribLocation(shader,materialAttrib,"material");
+ glBindAttribLocation(shader,colorAttrib,"color");
+ glBindAttribLocation(shader,widthAttrib,"width");
+
+ glLinkProgram(shader);
for(size_t i=0; i < n; ++i) {
- glDetachShader(mainShader,compiledShaders[i]);
+ glDetachShader(shader,compiledShaders[i]);
glDeleteShader(compiledShaders[i]);
}
- return mainShader;
+ return shader;
}
GLuint createShaders(GLchar const* src, int shaderType,