The Canvas class describes a canvas on which bgfx can draw.
More...
#include <vclib/bgfx/canvas.h>
|
|
using | CallbackReadBuffer = ReadBufferTypes::CallbackReadBuffer |
| |
|
|
| CanvasBGFX (void *winId, uint width, uint height, void *displayId=nullptr) |
| |
|
bgfx::FrameBufferHandle | frameBuffer () const |
| |
|
void | onInit () |
| | Automatically called by the DerivedRenderApp when the window initializes. Initialization is requires in some backends+window manager combinations, and therefore it must be implemented (also if empty) in every Canvas class.
|
| |
|
void | onPaint () |
| | Automatically called by the DerivedRenderApp when the window asks to repaint.
|
| |
| bool | onReadDepth (const Point2i &point, CallbackReadBuffer callback=nullptr) |
| | Automatically called by the DerivedRenderApp when a drawer asks to read the depth buffer at a specific point.
|
| |
| bool | onReadId (const Point2i &point, CallbackReadBuffer callback=nullptr) |
| | Automatically called by the DerivedRenderApp when a drawer asks to read the ID at a specific point.
|
| |
| void | onResize (uint width, uint height) |
| | Automatically called by the DerivedRenderApp when the window is resized.
|
| |
| bool | onScreenshot (const std::string &filename, uint multiplier=1) |
| | Automatically called by the DerivedRenderApp when a drawer asks for a screenshot. Also called by the public member function screenshot().
|
| |
| bool | screenshot (const std::string &filename, uint multiplier=1) |
| | Request a screenshot of the canvas. The screenshot will be saved asynchronously.
|
| |
|
void | setDefaultClearColor (const Color &color) |
| |
|
Point2< uint > | size () const |
| |
|
bgfx::ViewId | viewId () const |
| |
|
|
using | ByteData = ReadBufferTypes::ByteData |
| |
|
using | FloatData = ReadBufferTypes::FloatData |
| |
|
using | ReadData = ReadBufferTypes::ReadData |
| |
|
|
using | ReadFramebufferRequest = detail::ReadFramebufferRequest |
| |
|
|
uint32_t | mCurrFrame = 0 |
| |
|
vcl::Color | mDefaultClearColor = vcl::Color::Black |
| |
|
bgfx::FrameBufferHandle | mFbh = BGFX_INVALID_HANDLE |
| |
|
std::optional< ReadFramebufferRequest > | mReadRequest = std::nullopt |
| |
|
Point2< uint > | mSize = {0, 0} |
| |
|
bgfx::ViewId | mViewId = BGFX_INVALID_VIEW |
| |
|
void * | mWinId = nullptr |
| |
The Canvas class describes a canvas on which bgfx can draw.
◆ onReadDepth()
Automatically called by the DerivedRenderApp when a drawer asks to read the depth buffer at a specific point.
- Parameters
-
- Returns
◆ onReadId()
Automatically called by the DerivedRenderApp when a drawer asks to read the ID at a specific point.
- Parameters
-
| point | The point where the ID must be read. |
| callback | The callback function that will be called when the ID is read. |
- Returns
- true id the red Id request is successfully submitted, false otherwise.
◆ onResize()
Automatically called by the DerivedRenderApp when the window is resized.
- Parameters
-
◆ onScreenshot()
Automatically called by the DerivedRenderApp when a drawer asks for a screenshot. Also called by the public member function screenshot().
- Parameters
-
| filename | |
| multiplier | multiplier applied to the canvas image. |
- Returns
- true if the screenshot is requested, false otherwise.
- Note
- this function is asynchronous, the screenshot will be saved later.
◆ screenshot()
Request a screenshot of the canvas. The screenshot will be saved asynchronously.
- Parameters
-
| filename | The filename where the screenshot will be saved. |
| multiplier | The multiplier applied to the canvas image. |
- Returns
- true if the screenshot is requested, false otherwise.
The documentation for this class was generated from the following file:
- vclib/render/include/vclib/bgfx/canvas.h