public static ShaderSource ( |
||
shader | ||
@string | System | |
return | void |
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); }
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); } }
public void ShaderSource(GLShaderHandle shader, string source) { GL.ShaderSource((int)shader, "#version 120\n" + source); }
public void ShaderSource(GLShaderHandle shader, string source) { MacGL.ShaderSource((int)shader, source); }