SimpleWindow.draw

This lets you draw on the window (or its backing buffer) using basic 2D primitives.

Be sure to call this in a limited scope because your changes will not actually appear on the window until ScreenPainter's destructor runs.

  1. ScreenPainter draw()
  2. ScreenPainter draw(bool manualInvalidations)
    class SimpleWindow

Parameters

manualInvalidations bool

if you set this to true, you will need to set the invalid rectangle on the painter yourself. If false, it assumes the whole window has been redrawn each time you draw.

Only invalidated rectangles are blitted back to the window when the destructor runs. Doing this yourself can reduce flickering of child windows.

Return Value

an instance of ScreenPainter, which has the drawing methods on it to draw on this window.

Meta

History

The manualInvalidations parameter overload was added on December 30, 2021 (dub v10.5)