示例#1
0
        private int CreateShader(string shaderPath, ShaderType shaderType)
        {
            var shaderId = GL.CreateShader(shaderType);

            GL.ShaderSource(shaderId, ReadShaderSource(shaderPath));

            GL.CompileShader(shaderId);

            var infoLogVert = GL.GetShaderInfoLog(shaderId);

            if (infoLogVert != System.String.Empty)
            {
                System.Console.WriteLine(infoLogVert);
                return(-1);
            }

            return(shaderId);
        }