A client's graphics card: where its scenes are drawn, the
Cauldron2D.Drafter.Client.Stage that draws them, and what it does to the game's scenes.
Where comes from the picture options (gpu, window or software,
Cauldron2D.Drafter.Client.Picture) when they say, else from the player's drawing
setting (Cauldron2D.Drafter.Client.Settings), whose :auto draws on the card in the
pane. The stage starts the first time a scene with a :gpu arrives, so a game that
never describes one never starts a renderer.
The client keeps it under :gpu in its state:
new/1andconfigure/1work out where to draw;configure/1again after the drawing setting changes stops a stage that no longer fitstick/2, with each scene, starts the stage when it is wanted and sends the scene to a windowscene/2gives the scene the client draws: in the pane, a scene with a:gpuhas its:picturedrawn by the stage once it is ready; in a window, the pane's picture is empty from the moment the window starts opening; otherwise, and for scenes with no:gpu, the game's own:picturewith the:gpukey taken outmessage/2takes the stage's messages: window keys go to the app as terminal events, and a stage that fails or a window that closes leaves the game's own picture in its placenote/1is a note about the card for the few seconds after it is made; notes are made when the card was asked for by name (gpu,window, or the setting:paneor:window), not for:autostop/1stops the stage
While a window is open the client is told keys are released ({:key_release_support, true}); when it closes the terminal's own answer is restored.
Summary
Functions
The client state with where to draw worked out from its picture options and its
settings' drawing; a stage that no longer fits is stopped, and the next scene with a
:gpu starts one that does.
The client state after a message from its stage.
The state of a client whose picture options are options, before configure/1.
The note about the graphics card to show now, if any.
The scene the client draws for the game's scene.
Stops the client's stage, if it has one.
Starts the stage when the scene wants one, and sends the scene to an open window.
Types
Functions
The client state with where to draw worked out from its picture options and its
settings' drawing; a stage that no longer fits is stopped, and the next scene with a
:gpu starts one that does.
The client state after a message from its stage.
@spec new([Cauldron2D.Drafter.Client.Picture.option()]) :: t()
The state of a client whose picture options are options, before configure/1.
The note about the graphics card to show now, if any.
The scene the client draws for the game's scene.
@spec stop(map()) :: :ok
Stops the client's stage, if it has one.
Starts the stage when the scene wants one, and sends the scene to an open window.