An sdl_window shows sdl_layer
objects below its graphicals. The layers are drawn by the SDL renderer
of the frame rather than by Cairo, which makes this window suitable for
video: each frame of the video is uploaded and drawn by the renderer,
while the graphicals of the window, e.g.,
controls or annotations, are drawn on top and need not be redrawn.
new(C, camera),
send(C, texture, new(T, sdl_texture)),
new(W, sdl_window),
send(W, background, black),
send(W, append, sdl_layer(T)),
send(W, display, text('Live'), point(10, 10)),
send(W, open),
send(C, open).
window<-background
is drawn below the layers. The window has no scrollbars and its layers
do not scroll. To scroll, display the sdl_window on a picture.
Besides video, the layers are suitable for sprites, tiled backgrounds and other graphics that change on every frame. A layer may also draw the triangles of an sdl_mesh or show an sdl_canvas, an off-screen set of layers.