/// <summary>
/// Draw the surface directly to the game window. This will refresh the view,
/// and Display the surface, as well as clear it if AutoClear is true.
/// </summary>
/// <param name="game">The Game to render to.</param>
public void DrawToWindow(Game game)
{
RefreshView();
Display();
Drawable drawable = RenderShaders();
game.Window.Draw(drawable, _states);
if (_saveNextFrame)
{
_saveNextFrame = false;
var texture = new SFML.Graphics.Texture(game.Window.Size.X, game.Window.Size.Y);
texture.Update(game.Window);
var capture = texture.CopyToImage();
capture.SaveToFile(_saveNameFramePath);
}
if (AutoClear)
{
Clear(FillColor);
}
}