public ThreadedFrameBuffer(ThreadedGraphicsContext device, IFrameBuffer frameBuffer) { this.device = device; getTexture = () => frameBuffer.Texture; bind = frameBuffer.Bind; unbind = frameBuffer.Unbind; dispose = frameBuffer.Dispose; enableScissor = rect => frameBuffer.EnableScissor((Rectangle)rect); disableScissor = frameBuffer.DisableScissor; }
public void EnableScissor(Rectangle rect) { // Must remain inside the current scissor rect if (scissorState.Any()) { rect = Rectangle.Intersect(rect, scissorState.Peek()); } Flush(); if (renderType == RenderType.World) { worldBuffer.EnableScissor(rect); } else { Context.EnableScissor(rect.X, rect.Y, rect.Width, rect.Height); } scissorState.Push(rect); }