![]() |
ThorVG v1.0
|
A class for the rendering graphic elements with a GL raster engine. More...
#include <thorvg.h>


Public Member Functions | |
| Result | target (void *display, void *surface, void *context, int32_t id, uint32_t w, uint32_t h, ColorSpace cs) noexcept |
| Sets the drawing target for rasterization. | |
Public Member Functions inherited from Canvas | |
| const std::list< Paint * > & | paints () const noexcept |
| Returns the list of paints currently held by the Canvas. | |
| Result | push (Paint *target, Paint *at=nullptr) noexcept |
| Adds a paint object to the root scene. | |
| Result | remove (Paint *paint=nullptr) noexcept |
| Removes a paint object or all paint objects from the root scene. | |
| Result | update () noexcept |
| Requests the canvas to update modified paint objects in preparation for rendering. | |
| Result | draw (bool clear=false) noexcept |
| Requests the canvas to render the Paint objects. | |
| Result | viewport (int32_t x, int32_t y, int32_t w, int32_t h) noexcept |
| Sets the drawing region of the canvas. | |
| Result | sync () noexcept |
| Guarantees that drawing task is finished. | |
Static Public Member Functions | |
| static GlCanvas * | gen () noexcept |
| Creates a new GlCanvas object. | |
A class for the rendering graphic elements with a GL raster engine.
|
staticnoexcept |
|
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.
| [in] | display | The platform-specific display handle (EGLDisplay for EGL). Set nullptr for other systems. |
| [in] | surface | The platform-specific surface handle (EGLSurface for EGL, HDC for WGL). Set nullptr for other systems. |
| [in] | context | The OpenGL context to be used for rendering on this canvas. |
| [in] | id | The GL target ID, usually indicating the FBO ID. A value of 0 specifies the main surface. |
| [in] | w | The width (in pixels) of the raster image. |
| [in] | h | The height (in pixels) of the raster image. |
| [in] | cs | Specifies how the pixel values should be interpreted. Currently, it only allows ColorSpace::ABGR8888S as GL_RGBA8. |
| Result::InsufficientCondition | If the canvas is currently rendering. Ensure that Canvas::sync() has been called before setting a new target. |
| Result::NonSupport | In case the gl engine is not supported. |
display and surface are not provided, the ThorVG GL engine assumes that the appropriate OpenGL context is already current and will not attempt to bind a new one.