public static void Clear(ClearInfo clearInfo) { if (clearInfo.Colour != currentClearInfo.Colour) { GL.ClearColor(clearInfo.Colour); } if (clearInfo.Depth != currentClearInfo.Depth) { if (isEmbedded) { // GL ES only supports glClearDepthf // See: https://www.khronos.org/registry/OpenGL-Refpages/es3.0/html/glClearDepthf.xhtml GL.ClearDepth((float)clearInfo.Depth); } else { // Older desktop platforms don't support glClearDepthf, so standard GL's double version is used instead // See: https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glClearDepth.xhtml osuTK.Graphics.OpenGL.GL.ClearDepth(clearInfo.Depth); } } if (clearInfo.Stencil != currentClearInfo.Stencil) { GL.ClearStencil(clearInfo.Stencil); } GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit | ClearBufferMask.StencilBufferBit); currentClearInfo = clearInfo; }
public static void Clear(ClearInfo clearInfo) { if (clearInfo.Colour != currentClearInfo.Colour) { GL.ClearColor(clearInfo.Colour); } if (clearInfo.Depth != currentClearInfo.Depth) { // Todo: Wtf. osuTK's bindings are broken for glClearDepthf(). Using glClearDepth() for now osuTK.Graphics.OpenGL.GL.ClearDepth(clearInfo.Depth); } if (clearInfo.Stencil != currentClearInfo.Stencil) { GL.ClearStencil(clearInfo.Stencil); } GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit | ClearBufferMask.StencilBufferBit); currentClearInfo = clearInfo; }