private void ScissorClippingRegion() { Simple2DRenderer.Region clippingRegion = ClippingRegion; var x0 = clippingRegion.x0; var y0 = clippingRegion.y0; var x1 = clippingRegion.x1; var y1 = clippingRegion.y1; GL.Scissor(x0, glwindow_height - y1, x1 - x0, y1 - y0); }
public void PushClipping(Simple2DRenderer.Region region) { if (regions.Count == 0) { GL.Enable(EnableCap.ScissorTest); } if (regions.Count != 0) { Simple2DRenderer.Region region1 = regions.Peek(); if (region1.Equals(region)) { ++region1.count; return; } } regions.Push(region); ScissorClippingRegion(); }
public void PopClipping() { if (regions.Count != 0) { Simple2DRenderer.Region region = regions.Peek(); if (region.count > 0) { --region.count; return; } regions.Pop(); } if (regions.Count == 0) { GL.Disable(EnableCap.ScissorTest); } else { ScissorClippingRegion(); } }