// Draw directs each layer, starting from the bottom, to draw to the // screen, and then updates the necessary parts of the screen. func (stack LayerStack) Draw(screen *sdl.Surface) { screen.FillRect( &sdl.Rect{X: 0, Y: 0, W: uint16(screen.W), H: uint16(screen.H)}, 0, ) for i, layer := range stack { top := i == len(stack)-1 layer.Draw(screen, top) } screen.Flip() }