private void Link(Shader vertexShader, Shader pixelShader)
{
int program = GL.CreateProgram();
GL.AttachShader(program, vertexShader.GetShaderHandle());
GL.AttachShader(program, pixelShader.GetShaderHandle());
GL.LinkProgram(program);
GL.UseProgram(program);
vertexShader.GetVertexAttributeLocations(program);
pixelShader.ApplySamplerTextureUnits(program);
int @params = 0;
GL.GetProgram(program, ProgramParameter.LinkStatus, out @params);
if (@params == 0)
{
Console.WriteLine(GL.GetProgramInfoLog(program));
throw new InvalidOperationException("Unable to link effect program");
}
else
{
ShaderProgramInfo shaderProgramInfo;
shaderProgramInfo.program = program;
shaderProgramInfo.posFixupLoc = GL.GetUniformLocation(program, "posFixup");
this._programCache.Add(vertexShader.HashKey | pixelShader.HashKey, shaderProgramInfo);
}
}