public Shader(OpenGL gl, string vertexShaderSource, string fragmentShaderSource, Dictionary<uint, string> attributeLocations) { this.gl = gl; Compiled = false; CompilerOutput = null; shader = new SharpGL.Shaders.ShaderProgram(); try { shader.Create(gl, vertexShaderSource, fragmentShaderSource, attributeLocations); } catch (SharpGL.Shaders.ShaderCompilationException ex) { CompilerOutput = ex.CompilerOutput; return; } try { shader.AssertValid(gl); } catch (Exception ex) { CompilerOutput = ex.Message; return; } Compiled = true; }
public Shader(OpenGL gl, string vertexShaderSource, string fragmentShaderSource, Dictionary <uint, string> attributeLocations) { this.gl = gl; Compiled = false; CompilerOutput = null; shader = new SharpGL.Shaders.ShaderProgram(); try { shader.Create(gl, vertexShaderSource, fragmentShaderSource, attributeLocations); } catch (SharpGL.Shaders.ShaderCompilationException ex) { CompilerOutput = ex.CompilerOutput; return; } try { shader.AssertValid(gl); } catch (Exception ex) { CompilerOutput = ex.Message; return; } Compiled = true; }