public IFrameBuffer BeginFrameBuffer(ISquare square, IRuntimeSettings settings) { float width = square.MaxX - square.MinX; float height = square.MaxY - square.MinY; var aspectRatio = new SizeF(settings.WindowSize.Width / (float)settings.VirtualResolution.Width, settings.WindowSize.Height / (float)settings.VirtualResolution.Height); var frameBuffer = new GLFrameBuffer(new Size((int)Math.Ceiling(width * aspectRatio.Width), (int)Math.Ceiling(height * aspectRatio.Height)), _graphics); frameBuffer.Begin(); return(frameBuffer); }
public IFrameBuffer BeginFrameBuffer(AGSBoundingBox square, IRuntimeSettings settings) { float width = square.MaxX - square.MinX; float height = square.MaxY - square.MinY; var aspectRatio = new SizeF(settings.WindowSize.Width / CurrentResolution.Width, settings.WindowSize.Height / CurrentResolution.Height); var frameBuffer = new GLFrameBuffer(new Size((int)Math.Ceiling(width * aspectRatio.Width), (int)Math.Ceiling(height * aspectRatio.Height)), _graphics, _messagePump); if (!frameBuffer.Begin()) { frameBuffer.End(); return(null); } return(frameBuffer); }