public void Draw(RenderTexture canvas) { var sprite = new Sprite(canvas.Texture) { Position = new Vector2f() }; foreach (var viewport in ViewPorts) { viewport.Window.Clear(Color.Black); var rect = new IntRect( viewport.Window.Position.X - WorkingArea.Left, viewport.Window.Position.Y - WorkingArea.Top, viewport.WorkingArea.Width, viewport.WorkingArea.Height); sprite.TextureRect = rect; viewport.Window.Draw(sprite, RenderStates.Default); } ViewPorts.ForEach(x => x.Window.Draw(hack)); ViewPorts.ForEach(x => x.Window.Display()); }
public void HandleEvents() { ViewPorts.ForEach(x => x.Window.DispatchEvents()); }