string mixin only works once per block?

Vlad Levenfeld vlevenfeld at gmail.com
Fri Apr 11 07:50:13 PDT 2014


I changed link to this:

template link (alias variable)
{
	const string link ()
	{
		const string name = __traits (identifier, variable);
		return name~`= glGetUniformLocation (program, "`~name~`");`;
	}
}

but the results are the same - however
I've realized that the first mixin doesn't necessarily work - I 
think what is actually happening is that, since the variables 
never get written to, they retain their initial values, and this 
corresponds to the first uniform location in the shader, and so 
this location receives the variable when I upload the uniforms. 
(But then I would expect the last uniform I sent to assume the 
color but this isn't what happens, so I'm not sure).


More information about the Digitalmars-d-learn mailing list