Visual Computing Library  devel
Loading...
Searching...
No Matches
vcl::RenderApp< WindowManagerT, CanvasT, Drawers >::DRW Class Reference

The RenderApp::DRW inner class is an Attorney that allow access to some private member functions of the RenderApp class to the Drawer classes. More...

#include <vclib/render/render_app.h>

Static Public Member Functions

static auto canvasFrameBuffer (const RenderApp *r)
 A Drawer object can request the frame buffer of the canvas.
 
static Point2< uintcanvasSize (const RenderApp *r)
 A Drawer object can request the size of the canvas. This function is called by the Drawer object to request the size of the canvas.
 
static bool readDepth (RenderApp *r, const Point2i &point, ReadBufferTypes::CallbackReadBuffer callback=nullptr)
 A Drawer object can request the depth value at a specific point on the canvas. This function is called by the Drawer object to request the depth value at the specified point.
 
static bool readId (RenderApp *r, const Point2i &point, ReadBufferTypes::CallbackReadBuffer callback=nullptr)
 A Drawer object can request the ID at a specific point on the canvas. This function is called by the Drawer object to request the ID at the specified point.
 
static void screenshot (RenderApp *r, const std::string &filename, uint multiplier=1)
 A Drawer object can request a screenshot of the canvas. This function is called by the Drawer object to request a screenshot of the canvas.
 
static void setCanvasDefaultClearColor (RenderApp *r, const Color &color)
 A Drawer object can set the default clear color of the canvas.
 
static voidwindowPtr (RenderApp *r)
 A Drawer object can request the window pointer of the window manager (the exact meaning of the window pointer depends on the window manager implementation).
 

Detailed Description

template<template< typename > typename WindowManagerT, template< typename > typename CanvasT, template< typename > typename... Drawers>
class vcl::RenderApp< WindowManagerT, CanvasT, Drawers >::DRW

The RenderApp::DRW inner class is an Attorney that allow access to some private member functions of the RenderApp class to the Drawer classes.

The member functions of the RenderApp::DRW inner class can be called only by the Drawer classes. For example, to call the canvasFrameBuffer member function, the Drawer can call it in the following way:

static auto canvasFrameBuffer(const RenderApp *r)
A Drawer object can request the frame buffer of the canvas.
Definition render_app.h:709
The RenderApp class is a template class that combines a canvas, a window manager, and a set of drawer...
Definition render_app.h:67

Member Function Documentation

◆ canvasFrameBuffer()

template<template< typename > typename WindowManagerT, template< typename > typename CanvasT, template< typename > typename... Drawers>
static auto vcl::RenderApp< WindowManagerT, CanvasT, Drawers >::DRW::canvasFrameBuffer ( const RenderApp r)
inlinestatic

A Drawer object can request the frame buffer of the canvas.

This function is called by the Drawer object to request the frame buffer of the canvas, that can be used to draw on it.

Warning
This function is supported only if the backend is bgfx.
Returns
The frame buffer of the canvas.

◆ canvasSize()

template<template< typename > typename WindowManagerT, template< typename > typename CanvasT, template< typename > typename... Drawers>
static Point2< uint > vcl::RenderApp< WindowManagerT, CanvasT, Drawers >::DRW::canvasSize ( const RenderApp r)
inlinestatic

A Drawer object can request the size of the canvas. This function is called by the Drawer object to request the size of the canvas.

Returns
The size of the canvas.

// TODO is this actually necessary???

◆ readDepth()

template<template< typename > typename WindowManagerT, template< typename > typename CanvasT, template< typename > typename... Drawers>
static bool vcl::RenderApp< WindowManagerT, CanvasT, Drawers >::DRW::readDepth ( RenderApp r,
const Point2i point,
ReadBufferTypes::CallbackReadBuffer  callback = nullptr 
)
inlinestatic

A Drawer object can request the depth value at a specific point on the canvas. This function is called by the Drawer object to request the depth value at the specified point.

Parameters
[in]pointThe point on the canvas where the depth value must be read.
[in]callbackThe callback function that will be called when the depth value is read. The callback function should have the following signature: void callback(const ReadData& value), where value float depth value read from the canvas.
Returns
true if the depth requeste is successfully submitted, false otherwise.

◆ readId()

template<template< typename > typename WindowManagerT, template< typename > typename CanvasT, template< typename > typename... Drawers>
static bool vcl::RenderApp< WindowManagerT, CanvasT, Drawers >::DRW::readId ( RenderApp r,
const Point2i point,
ReadBufferTypes::CallbackReadBuffer  callback = nullptr 
)
inlinestatic

A Drawer object can request the ID at a specific point on the canvas. This function is called by the Drawer object to request the ID at the specified point.

Parameters
[in]pointThe point on the canvas where the ID must be read.
[in]callbackThe callback function that will be called when the ID is read. The callback function should have the following signature: void callback(const ReadData& value), where value is the ID value read from the canvas encoded into 4 bytes (unsigned 32 bit integer).
Returns
true if the ID request is successfully submitted, false otherwise.

◆ screenshot()

template<template< typename > typename WindowManagerT, template< typename > typename CanvasT, template< typename > typename... Drawers>
static void vcl::RenderApp< WindowManagerT, CanvasT, Drawers >::DRW::screenshot ( RenderApp r,
const std::string &  filename,
uint  multiplier = 1 
)
inlinestatic

A Drawer object can request a screenshot of the canvas. This function is called by the Drawer object to request a screenshot of the canvas.

Parameters
[in]filenameThe filename where the screenshot will be saved.
[in]multiplierThe multiplier that will be applied to the canvas image. The default value is 1.

◆ setCanvasDefaultClearColor()

template<template< typename > typename WindowManagerT, template< typename > typename CanvasT, template< typename > typename... Drawers>
static void vcl::RenderApp< WindowManagerT, CanvasT, Drawers >::DRW::setCanvasDefaultClearColor ( RenderApp r,
const Color color 
)
inlinestatic

A Drawer object can set the default clear color of the canvas.

This function is called by the Drawer object to set the default clear color of the canvas.

Parameters
colorThe new default clear color of the canvas.

◆ windowPtr()

template<template< typename > typename WindowManagerT, template< typename > typename CanvasT, template< typename > typename... Drawers>
static void * vcl::RenderApp< WindowManagerT, CanvasT, Drawers >::DRW::windowPtr ( RenderApp r)
inlinestatic

A Drawer object can request the window pointer of the window manager (the exact meaning of the window pointer depends on the window manager implementation).

To get the window pointer, the Drawer object can call the windowPtr() function. To know the exact meaning of the window pointer, the Drawer object should refer to the documentation of the specific window manager implementation, and check the WINDOW_MANAGER_ID of the window manager, that is a static constant of the WindowManager class.

Parameters
r
Returns

The documentation for this class was generated from the following file: