Simp module

texture_create_render_target

procedureSource

Makes an empty texture that can be drawn into: make it current with set_render_target, then draw as usual.

Example
#import "Window_Creation";

window := create_window(800, 600, "simp");
target := texture_create_render_target(512, 512, .RGBA8);
set_render_target(*target);
// ... draw ...
set_render_target(window);
// now draw `target` like any texture

This one is only checked to compile, not run.

texture_create_render_target :: (
    width: s32,
    height: s32,
    format: Texture_Format,
    flags: Texture_Flags = 0
) -> Texture

Makes an empty texture that can be drawn into: make it current with set_render_target, then draw as usual.

Parameters

width: s32
in pixels.
height: s32
in pixels.
format: Texture_Format
how a pixel is stored, for instance .RGBA8.
flags: Texture_Flags = 0
extra Texture_Flags, such as .sRGB. .Render_Target is always added.

Returns

Example
#import "Window_Creation";

window := create_window(800, 600, "simp");
target := texture_create_render_target(512, 512, .RGBA8);
set_render_target(*target);
// ... draw ...
set_render_target(window);
// now draw `target` like any texture

This one is only checked to compile, not run.

See also