コード例 #1
0
 public ShaderProgram Link()
 {
     Log.Debug("Hope", $"Linking shader program {ProgramCode}");
     GL.LinkProgram(ProgramCode);
     Hope.AssertNoGLError();
     return(this);
 }
コード例 #2
0
        public Shader(ShaderType shaderType, string source)
        {
            Log.Debug("Hope", $"Creating a new {shaderType}");
            ShaderCode = GL.CreateShader(shaderType);

            Log.Debug("Hope", $"Reading {shaderType} source to shader {ShaderCode}");
            GL.ShaderSource(ShaderCode, 1, new[] { source }, (int[])null);
            Log.Debug("Hope", $"Compiling {shaderType} {ShaderCode}");
            GL.CompileShader(ShaderCode);
            Hope.AssertNoGLError();

            CheckShaderError();
            Log.Debug("Hope", $"{shaderType} created with no errors");
        }