public void SetViewport(int x, int y, int width, int height) { x = Util.Clamp(x, 0, ViewportMax.Width - 2); y = Util.Clamp(y, 0, ViewportMax.Height - 2); width = Util.Clamp(width, 1, ViewportMax.Width - x); height = Util.Clamp(height, 1, ViewportMax.Height - y); Viewport.X = x; Viewport.Y = y; Viewport.Width = width; Viewport.Height = height; if (BackBuffer == null) { BackBuffer = new ColorBuffer(width, height); } else { BackBuffer.SetSize(width, height); } if (DepthBuffer == null) { DepthBuffer = new gl.DepthBuffer(width, height); } else { DepthBuffer.SetSize(width, height); } }
public void SetViewport(int x, int y, int width, int height) { ViewPort = new Rectangle(x, y, width, height); if (BackBuffer == null) { BackBuffer = new ColorBuffer(width, height); } else { BackBuffer.SetSize(width, height); } }