using OpenTK.Graphics.OpenGL; ... GL.ClearColor(0.0f, 0.0f, 0.0f, 1.0f); // Set the color to clear the buffer GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit); // Clear the frame buffer with the specified color
using OpenTK.Graphics.OpenGL; ... GL.Clear(ClearBufferMask.DepthBufferBit); // Clear only the depth bufferThis code snippet clears only the depth buffer, leaving the color buffer unchanged. These examples use the OpenTK library, which is a C# wrapper for the OpenGL library.