UI module

present

procedureextensionexperimentalsince 0.31.0Source

Draw the UI's display list into the window. Returns false when there was nothing to draw into (the window is hidden) and the frame should be tried again.

Example↗
#import "Window_Creation";

ui := headless();
defer free_ui(*ui);
window := create_window(800, 600, "ui");
renderer := create_window_renderer(window, 800, 600);
present(renderer, *ui, rgb(20, 20, 30));

This one is only checked to compile, not run.

present :: (r: *Renderer, ui: *UI_State, clear: Color) -> bool

Draw the UI's display list into the window. Returns false when there was nothing to draw into (the window is hidden) and the frame should be tried again.

Parameters

r: *Renderer
the window renderer.
ui: *UI_State
the UI whose display list to draw.
clear: Color
the colour the window is cleared to first.

Returns

bool
Example↗
#import "Window_Creation";

ui := headless();
defer free_ui(*ui);
window := create_window(800, 600, "ui");
renderer := create_window_renderer(window, 800, 600);
present(renderer, *ui, rgb(20, 20, 30));

This one is only checked to compile, not run.

See also