Example #1
0
        public void Dispose()
        {
            if (ProgramID != 0)
            {
                // Make sure this program isn't being used
                if (Gl.CurrentProgram == ProgramID)
                {
                    Gl.UseProgram(0);
                }

                Gl.DetachShader(ProgramID, VertexShader.ShaderID);
                Gl.DetachShader(ProgramID, FragmentShader.ShaderID);
                Gl.DeleteProgram(ProgramID);

                if (DisposeChildren)
                {
                    VertexShader.Dispose();
                    FragmentShader.Dispose();
                }

                this.ProgramID = 0;
            }
        }
Example #2
0
 protected override void Release() => Gl.DeleteProgram(_hdc);
 /// <summary>
 /// Delete a ShaderProgram name.
 /// </summary>
 /// <param name="ctx">
 /// A <see cref="GraphicsContext"/> used for deleting this object name.
 /// </param>
 /// <param name="name">
 /// A <see cref="UInt32"/> that specify the object name to delete.
 /// </param>
 protected override void DeleteName(GraphicsContext ctx, uint name)
 {
     // Delete program
     Gl.DeleteProgram(name);
 }