Draw the UI's display list offscreen and read the pixels back. Free pixels with array_free.
- r: the offscreen renderer.
- ui: the UI whose display list to draw.
- clear: the colour the target is cleared to first.
ui := headless();
defer free_ui(*ui);
renderer := create_offscreen_renderer(320, 200);
defer destroy_renderer(renderer);
image := render_to_image(renderer, *ui, rgb(255, 255, 255));This one is only checked to compile, not run.
render_to_image :: (r: *Renderer, ui: *UI_State, clear: Color) -> Rendered_Image
Draw the UI's display list offscreen and read the pixels back. Free pixels with array_free.
Parameters
- r: *Renderer
- the offscreen renderer.
- ui: *UI_State
- the UI whose display list to draw.
- clear: Color
- the colour the target is cleared to first.
Returns
ui := headless();
defer free_ui(*ui);
renderer := create_offscreen_renderer(320, 200);
defer destroy_renderer(renderer);
image := render_to_image(renderer, *ui, rgb(255, 255, 255));This one is only checked to compile, not run.