ThorVG  v0.13
GlCanvasfinal

A class for the rendering graphic elements with a GL raster engine. More...

Inheritance diagram for GlCanvas:

Public Member Functions

Result target (int32_t id, uint32_t w, uint32_t h) noexcept
 Sets the drawing target for rasterization. More...
 
- Public Member Functions inherited from Canvas
TVG_DEPRECATED Result reserve (uint32_t n) noexcept
 Sets the size of the container, where all the paints pushed into the Canvas are stored. More...
 
std::list< Paint * > & paints () noexcept
 Returns the list of the paints that currently held by the Canvas. More...
 
virtual Result push (std::unique_ptr< Paint > paint) noexcept
 Passes drawing elements to the Canvas using Paint objects. More...
 
virtual Result clear (bool free=true) noexcept
 Clear the internal canvas resources that used for the drawing. More...
 
virtual Result update (Paint *paint=nullptr) noexcept
 Request the canvas to update the paint objects. More...
 
virtual Result draw () noexcept
 Requests the canvas to draw the Paint objects. More...
 
virtual Result sync () noexcept
 Guarantees that drawing task is finished. More...
 

Static Public Member Functions

static std::unique_ptr< GlCanvasgen () noexcept
 Creates a new GlCanvas object. More...
 

Detailed Description

A class for the rendering graphic elements with a GL raster engine.

Warning
Please do not use it. This class is not fully supported yet.
Note
Experimental API

Member Function Documentation

◆ gen()

static std::unique_ptr<GlCanvas> gen ( )
staticnoexcept

Creates a new GlCanvas object.

Returns
A new GlCanvas object.
Note
Experimental API

◆ target()

Result target ( int32_t  id,
uint32_t  w,
uint32_t  h 
)
noexcept

Sets the drawing target for rasterization.

This function specifies the drawing target where the rasterization will occur. It can target a specific framebuffer object (FBO) or the main surface.

Parameters
[in]idThe GL target ID, usually indicating the FBO ID. A value of 0 specifies the main surface.
[in]wThe width (in pixels) of the raster image.
[in]hThe height (in pixels) of the raster image.
Warning
This API is experimental and not officially supported. It may be modified or removed in future versions.
Drawing on the main surface is currently not permitted. If the identifier (id) is set to 0, the operation will be aborted.
Note
Currently, this only allows the GL_RGBA8 color space format.
Experimental API