Create a renderer drawing into an offscreen texture of width by height pixels, for tests and
screenshots. Returns null if no adapter is available.
- width: the target width in pixels.
- height: the target height in pixels.
ui := headless();
defer free_ui(*ui);
renderer := create_offscreen_renderer(640, 480);
defer destroy_renderer(renderer);
image := render_to_image(renderer, *ui, rgb(20, 20, 30));This one is only checked to compile, not run.
create_offscreen_renderer :: (width: int, height: int) -> *Renderer
Create a renderer drawing into an offscreen texture of width by height pixels, for tests and
screenshots. Returns null if no adapter is available.
Parameters
- width: int
- the target width in pixels.
- height: int
- the target height in pixels.
Returns
ui := headless();
defer free_ui(*ui);
renderer := create_offscreen_renderer(640, 480);
defer destroy_renderer(renderer);
image := render_to_image(renderer, *ui, rgb(20, 20, 30));This one is only checked to compile, not run.