gltk.program: bind attribute location before linking program
This commit is contained in:
1 parent
2ec33ff1c0
commit
8e6ec5f820
1 file changed
+5
-4
@@ -230,6 +230,11 @@ class Program(string[string] uniforms = [], int[string] attributes = [])
|
||||
*/
|
||||
public void link()
|
||||
{
|
||||
static foreach(attribute_name, attribute_location; attributes)
|
||||
{
|
||||
glBindAttribLocation(m_id, attribute_location, attribute_name.toStringz());
|
||||
}
|
||||
|
||||
glLinkProgram(m_id);
|
||||
|
||||
GLint link_status;
|
||||
@@ -254,10 +259,6 @@ class Program(string[string] uniforms = [], int[string] attributes = [])
|
||||
{
|
||||
mixin("m_uniform_" ~ uniform_name ~ " = glGetUniformLocation(m_id, \"" ~ uniform_name ~ "\");");
|
||||
}
|
||||
static foreach(attribute_name, attribute_location; attributes)
|
||||
{
|
||||
glBindAttribLocation(m_id, attribute_location, attribute_name.toStringz());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user