CRset_render_target: Sets texture as rendering target.

View source: R/CRset_render_target.R

CRset_render_targetR Documentation

Sets texture as rendering target.

Description

Changes rendering target from window belonging to graphics_list to some texture created by CRcreate_texture. Use CRreset_render_target to set window as rendering target again. See CRcreate_texture for more info.

Usage

    CRset_render_target(graphics_list, texture_list, index, status = NULL)

Arguments

graphics_list

List containing pointers to window, renderer etc. created with CRopen.

texture_list

List of textures created with CRcreate_texture.

index

Index of texture intended to be target in texture_list.

Examples

    mytexture <- CRcreate_texture(mygraphics, list(), 300, 300)
    CRset_render_target(mygraphics, mytexture, 1 ) # set rendering target as first texture in mytexture
    CRdraw_rect(mygraphics, list(x=50, y=50, w=100, h=100))
    CRdraw_rect(mygraphics, list(x=20, y=30, w= 80, h= 80))
    CRdraw_rect(mygraphics, list(x=10, y=20, w= 30, h= 40))
    CRreset_render_target(mygraphics)
    CRdraw_texture(mygraphics, mytexture, 1)

lorweiuk/CREx documentation built on March 16, 2024, 3:04 a.m.