Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches

Class: kodi::gui::controls::CRendering

Window control for rendering own parts
This rendering control is used when own parts are needed. More...

Functions

 kodi::gui::controls::CRendering::CRendering (CWindow *window, int controlId)
 Construct a new control.
 
 kodi::gui::controls::CRendering::~CRendering () override
 Destructor.
 
virtual bool kodi::gui::controls::CRendering::Create (int x, int y, int w, int h, kodi::HardwareContext device)
 To create rendering control on Add-on.
 
virtual void kodi::gui::controls::CRendering::Render ()
 Render process call from Kodi.
 
virtual void kodi::gui::controls::CRendering::Stop ()
 Call from Kodi to stop rendering process.
 
virtual bool kodi::gui::controls::CRendering::Dirty ()
 Call from Kodi where add-on becomes asked about dirty rendering region.
 
void kodi::gui::controls::CRendering::SetIndependentCallbacks (kodi::gui::ClientHandle cbhdl, bool(*CBCreate)(kodi::gui::ClientHandle cbhdl, int x, int y, int w, int h, kodi::HardwareContext device), void(*CBRender)(kodi::gui::ClientHandle cbhdl), void(*CBStop)(kodi::gui::ClientHandle cbhdl), bool(*CBDirty)(kodi::gui::ClientHandle cbhdl))
 If the class is used independent (with "new CRendering") and not as parent (with "cCLASS_own : CRendering") from own must be the callback from Kodi to add-on overdriven with own functions!
 

Detailed Description

Class: kodi::gui::controls::CRendering

Window control for rendering own parts
This rendering control is used when own parts are needed.

You have the control over them to render direct OpenGL or DirectX content to the screen set by the size of them.

Alternative can be the virtual functions from t his been ignored if the callbacks are defined by the CRendering_SetIndependentCallbacks function and class is used as single and not as a parent class.

It has the header #include <kodi/gui/controls/Rendering.h> be included to enjoy it.

Here you find the needed skin part for a rendering control.

Note
The call of the control is only possible from the corresponding window as its class and identification number is required.

Function Documentation

◆ Create()

virtual bool kodi::gui::controls::CRendering::Create ( int x,
int y,
int w,
int h,
kodi::HardwareContext device )
inlinevirtual

To create rendering control on Add-on.

Function creates the needed rendering control for Kodi which becomes handled and processed from Add-on

Note
This is callback function from Kodi to Add-on and not to use for calls from add-on to this function.
Parameters
[in]xHorizontal position
[in]yVertical position
[in]wWidth of control
[in]hHeight of control
[in]deviceThe device to use. For OpenGL is empty on Direct X is the needed device send.
Returns
Add-on needs to return true if successed, otherwise false.
Note
The kodi::HardwareContext is basically a simple pointer which has to be changed to the desired format at the corresponding places using static_cast<...>(...).

◆ CRendering()

kodi::gui::controls::CRendering::CRendering ( CWindow * window,
int controlId )
inline

Construct a new control.

Parameters
[in]windowRelated window control class
[in]controlIdUsed skin xml control id

◆ Dirty()

virtual bool kodi::gui::controls::CRendering::Dirty ( )
inlinevirtual

Call from Kodi where add-on becomes asked about dirty rendering region.

Note
This is callback function from Kodi to Add-on and not to use for calls from add-on to this function.
Returns
True if a render region is dirty and need rendering.

◆ Render()

virtual void kodi::gui::controls::CRendering::Render ( )
inlinevirtual

Render process call from Kodi.

Note
This is callback function from Kodi to Add-on and not to use for calls from add-on to this function.

◆ SetIndependentCallbacks()

void kodi::gui::controls::CRendering::SetIndependentCallbacks ( kodi::gui::ClientHandle cbhdl,
bool(* CBCreate )(kodi::gui::ClientHandle cbhdl, int x, int y, int w, int h, kodi::HardwareContext device),
void(* CBRender )(kodi::gui::ClientHandle cbhdl),
void(* CBStop )(kodi::gui::ClientHandle cbhdl),
bool(* CBDirty )(kodi::gui::ClientHandle cbhdl) )
inline

If the class is used independent (with "new CRendering") and not as parent (with "cCLASS_own : CRendering") from own must be the callback from Kodi to add-on overdriven with own functions!

Parameters
[in]cbhdlAddon related class point where becomes given as value on related functions.
[in]CBCreateExternal creation function pointer, see also Create about related values
[in]CBRenderExternal render function pointer, see also Render about related values
[in]CBStopExternal stop function pointer, see also Stop about related values
[in]CBDirtyExternal dirty function pointer, see also Dirty about related values

◆ Stop()

virtual void kodi::gui::controls::CRendering::Stop ( )
inlinevirtual

Call from Kodi to stop rendering process.

Note
This is callback function from Kodi to Add-on and not to use for calls from add-on to this function.

◆ ~CRendering()

kodi::gui::controls::CRendering::~CRendering ( )
inlineoverride

Destructor.