gltk.program: bind attribute location before linking program
This commit is contained in:
parent
2ec33ff1c0
commit
8e6ec5f820
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user