opaque RenderTarget
type RenderTarget* = struct { _: ^struct{} }
An image you can render to.
fn mk
fn mk*(size: th::Vf2, filter: image::Filter): (RenderTarget, std::Err) {
Creates a render target you can draw to, like to a window.
Filter specifies specfifies filtering for resulting image.
Image can be retrieved via toImage
.
fn RenderTarget.begin
fn (rt: ^RenderTarget) begin*(): std::Err {
Begins the render target rendering pass.
fn RenderTarget.end
fn (rt: ^RenderTarget) end*(): std::Err {
Ends the render target rendering pass.
fn RenderTarget.toImage
fn (rt: ^RenderTarget) toImage*(): image::Image {
Returns the image of the render target. The resulting image has the same
lifetime as the base RenderTarget. If you need to use it past the lifetime
of the RenderTarget, use the copy method.
Do not call setfilter
on the resulting image.