public void Link() { _uniformCache.Clear(); _handle = GL.CreateProgram(); if (Name != null) { _clyde._objectLabelMaybe(ObjectLabelIdentifier.Program, _handle, Name); } if (_vertexShader != null) { GL.AttachShader(_handle, _vertexShader.Handle); } if (_fragmentShader != null) { GL.AttachShader(_handle, _fragmentShader.Handle); } GL.LinkProgram(_handle); GL.GetProgram(_handle, GetProgramParameterName.LinkStatus, out var compiled); if (compiled != 1) { throw new ShaderCompilationException(GL.GetProgramInfoLog(_handle)); } }
public Shader(Clyde clyde, ShaderType type, string shaderSource, string name = null) { _clyde = clyde; Compile(type, shaderSource); if (name != null) { _clyde._objectLabelMaybe(ObjectLabelIdentifier.Shader, ObjectHandle, name); } }
public Buffer(Clyde clyde, BufferTarget type, BufferUsageHint usage, string name = null) { _clyde = clyde; Type = type; Name = name; UsageHint = usage; GL.GenBuffers(1, out uint handle); ObjectHandle = handle; if (name != null) { _clyde._objectLabelMaybe(ObjectLabelIdentifier.Buffer, ObjectHandle, name); } }
public Buffer(Clyde clyde, BufferTarget type, BufferUsageHint usage, string name = null) { _clyde = clyde; Type = type; Name = name; UsageHint = usage; Handle = GL.GenBuffer(); Use(); if (name != null) { _clyde._objectLabelMaybe(ObjectLabelIdentifier.Buffer, Handle, name); } }