ShaderSource() public static method

public static ShaderSource ( Int32 shader, System @string ) : void
shader System.Int32
@string System
return void
Ejemplo n.º 1
0
        public static int CreateShader(string shaderSource, ShaderType type)
        {
            int shaderHandle = GL.CreateShader(type);

            GL.ShaderSource(shaderHandle, shaderSource);
            GL.CompileShader(shaderHandle);
            Console.WriteLine(GL.GetShaderInfoLog(shaderHandle));
            return(shaderHandle);
        }
Ejemplo n.º 2
0
        private int loadShader(ShaderType type, string file)
        {
            try
            {
                string ext = type == ShaderType.VertexShader ? ".vsh" : ".fsh";

                int ID = GL.CreateShader(type);

                var text = File.ReadAllText(file + ext);

                GL.ShaderSource(ID, text);
                GL.CompileShader(ID);

                GL.GetShader(ID, ShaderParameter.CompileStatus, out var status);

                return(status != -1 ? ID : -1);
            }
            catch
            {
                return(-1);
            }
        }
Ejemplo n.º 3
0
 public void ShaderSource(GLShaderHandle shader, string source)
 {
     GL.ShaderSource((int)shader, "#version 120\n" + source);
 }
Ejemplo n.º 4
0
 public void ShaderSource(GLShaderHandle shader, string source)
 {
     MacGL.ShaderSource((int)shader, source);
 }