Banuba SDK
Loading...
Searching...
No Matches
bnb::player_api::interfaces::render_target Class Referenceabstract

Responsible for preparation for drawing frames to 'outputs'. More...

#include <render_target.hpp>

Inheritance diagram for bnb::player_api::interfaces::render_target:
bnb::player_api::metal_render_target bnb::player_api::opengl_render_target

Public Member Functions

virtual ~render_target ()=default
 Destroy render_target and release resources.
virtual void attach (player &player)=0
 Attach render_target to the player.
virtual void detach (player &player)=0
 Detach render_target from the player.
virtual void prepare_to_offscreen_render (int32_t width, int32_t height)=0
 Prepare render target to offscreen rendering of the player.
virtual void prepare_to_screen_render (void *surface)=0
 Prepare render target to screen rendering.
virtual void set_frame_time_us (uint64_t time_us) noexcept=0
 Set presentation frame time.
virtual uint64_t get_frame_time_us () const noexcept=0
 Get frame time microseconds.
virtual int32_t get_render_width () const noexcept=0
 Get render surface size width.
virtual int32_t get_render_height () const noexcept=0
 Get render surface size height.
virtual texture_t get_output_texture () const noexcept=0
 Returns the drawn texture.
virtual void present (int32_t left, int32_t top, int32_t width, int32_t height, const float *const mat4)=0
 Draw the frame on the prepared surface.

Detailed Description

Responsible for preparation for drawing frames to 'outputs'.

This part of the RenderTarget is owned and controlled only by the player

Definition at line 26 of file render_target.hpp.

Member Function Documentation

◆ attach()

virtual void bnb::player_api::interfaces::render_target::attach ( player & player)
pure virtual

Attach render_target to the player.

Called by the player on the render thread.

Parameters
playerinstance

◆ detach()

virtual void bnb::player_api::interfaces::render_target::detach ( player & player)
pure virtual

Detach render_target from the player.

Called by the player on the render thread.

Parameters
playerinstance

◆ get_output_texture()

virtual texture_t bnb::player_api::interfaces::render_target::get_output_texture ( ) const
pure virtualnoexcept

Returns the drawn texture.

With an OpenGL backend, to get an opengl texture you need to do this: reinterpret_cast<GLuint>(render_terget->get_output_texture())

◆ prepare_to_offscreen_render()

virtual void bnb::player_api::interfaces::render_target::prepare_to_offscreen_render ( int32_t width,
int32_t height )
pure virtual

Prepare render target to offscreen rendering of the player.

Parameters
widthrendering surface width
heightrendering surface height

◆ prepare_to_screen_render()

virtual void bnb::player_api::interfaces::render_target::prepare_to_screen_render ( void * surface)
pure virtual

Prepare render target to screen rendering.

Parameters
surfacerendering surface

◆ present()

virtual void bnb::player_api::interfaces::render_target::present ( int32_t left,
int32_t top,
int32_t width,
int32_t height,
const float *const mat4 )
pure virtual

Draw the frame on the prepared surface.

Parameters
leftviewport x coord
topviewport y coord
widthof the viewport
heightof the viewport
mat4texture matrix

◆ set_frame_time_us()

virtual void bnb::player_api::interfaces::render_target::set_frame_time_us ( uint64_t time_us)
pure virtualnoexcept

Set presentation frame time.

Parameters
time_ustime in microseconds

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