public unsafe GPUShaderProgram CreateShaderProgram(GPUShader vertex, GPUShader fragment, GPUShader geometry = null, GPUShader tessEval = null, GPUShader tessCtrl = null) { GPUShaderProgram sProgram = new GPUShaderProgram(Gl.glCreateProgram()); if (vertex != null) { Gl.glAttachShader(sProgram, vertex); } if (fragment != null) { Gl.glAttachShader(sProgram, fragment); } if (geometry != null) { Gl.glAttachShader(sProgram, geometry); } if (tessEval != null) { Gl.glAttachShader(sProgram, tessEval); } if (tessCtrl != null) { Gl.glAttachShader(sProgram, tessCtrl); } Gl.glLinkProgram(sProgram); int success = 1; Gl.glGetProgramiv(sProgram, Gl.GL_LINK_STATUS, &success); if (success == 0) { StringBuilder builder = new StringBuilder(512); int length; Gl.glGetProgramInfoLog(sProgram, 512, out length, builder); Console.WriteLine(builder.ToString()); } return(sProgram); }
public void DeleteShader(GPUShader shader) { Gl.glDeleteShader(shader); _textures.Remove(shader); }