/// <summary> /// Clear surface buffers. /// </summary> /// <param name="ctx"> /// A <see cref="GraphicsContext"/> used for clearing buffers. /// </param> /// <param name="bufferMask"> /// A <see cref="ClearBufferMask"/> indicating which buffers to clear. /// </param> public void Clear(GraphicsContext ctx, ClearBufferMask bufferMask) { // Update clear values (only what is necessary) if ((bufferMask & ClearBufferMask.ColorBufferBit) != 0) { Gl.ClearColor(mClearColor.r, mClearColor.g, mClearColor.b, mClearColor.a); } #if !MONODROID if ((bufferMask & ClearBufferMask.DepthBufferBit) != 0) { Gl.ClearDepth(mClearDepth); } #else if ((bufferMask & ClearBufferMask.DepthBufferBit) != 0) { Gl.ClearDepth((float)mClearDepth); } #endif if ((bufferMask & ClearBufferMask.StencilBufferBit) != 0) { Gl.ClearStencil(mClearStencil); } // Clear Gl.Clear(bufferMask); }
/// <summary> /// Clear surface buffers. /// </summary> /// <param name="ctx"> /// A <see cref="GraphicsContext"/> used for clearing buffers. /// </param> /// <param name="bufferMask"> /// A <see cref="ClearBufferMask"/> indicating which buffers to clear. /// </param> public void Clear(GraphicsContext ctx, ClearBufferMask bufferMask) { // Update clear values (only what is necessary) if ((bufferMask & ClearBufferMask.ColorBufferBit) != 0) { Gl.ClearColor(mClearColor.Red, mClearColor.Green, mClearColor.Blue, mClearColor.Alpha); } if ((bufferMask & ClearBufferMask.DepthBufferBit) != 0) { Gl.ClearDepth(mClearDepth); } if ((bufferMask & ClearBufferMask.StencilBufferBit) != 0) { Gl.ClearStencil(mClearStencil); } // Clear Gl.Clear(bufferMask); }