コード例 #1
0
 /// <summary>
 /// Compiles and links vertex and fragment shaders from strings.
 /// </summary>
 /// <param name="shaderProgram">The empty shader to which the two shader sources are linked to.</param>
 /// <param name="sVertexShd_">The vertex shader source code string.</param>
 /// <param name="sFragmentShd_">The fragment shader source code string.</param>
 /// <returns>The shader log, Empty if no errors.</returns>
 public static string FromStrings(this IShaderProgram shaderProgram, string sVertexShd_, string sFragmentShd_)
 {
     shaderProgram.Compile(sVertexShd_, ShaderType.VertexShader);
     shaderProgram.Compile(sFragmentShd_, ShaderType.FragmentShader);
     shaderProgram.Link();
     return(shaderProgram.LastLog);
 }