Visual Computing Library
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 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).
 
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 void setCanvasDefaultClearColor (RenderApp *r, const Color &color)
 A Drawer object can set the default clear color of the canvas.
 
static auto canvasFrameBuffer (const RenderApp *r)
 A Drawer object can request the frame buffer 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 void screenshot (RenderApp *r, const std::string &filename, uint width=0, uint height=0)
 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.
 

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:684
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. TODO: explain the callback function signature.
Returns
true if the depth value is successfully read, 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  width = 0,
uint  height = 0 
)
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]widthThe width of the screenshot. If 0, the width of the canvas will be used.
[in]heightThe height of the screenshot. If 0, the height of the canvas will be used.

◆ 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: