gltk.program: bind attribute location before linking program

This commit is contained in:
Josh Holtrop 2024-01-22 19:32:56 -05:00
parent 2ec33ff1c0
commit 8e6ec5f820

View File

@ -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());
}
}
/**