Loading...
Searching...
No Matches
RenderTarget

#include <Ultralight/RenderTarget.h>

Overview

Offscreen render target, used when rendering Views via the GPU renderer.

When a View is rendered via the GPU renderer (see View::is_accelerated), it will be rendered to an offscreen render target (View::render_target) that you can display in your application.

This is intended to be used with a custom GPUDriver implementation in a game or similar application.

Displaying the Render Target

To display the View's render target, you should:

  1. Retrieve the underlying texture via RenderTarget::texture_id().
  2. Bind the texture using your custom GPUDriver implementation.
  3. Draw a textured quad with the provided UV coordinates (RenderTarget::uv_coords()).

Public Member Functions

 RenderTarget ()
 

Public Attributes

bool is_empty
 Whether this target is empty (null texture)
 
uint32_t width
 The viewport width (in device coordinates).
 
uint32_t height
 The viewport height (in device coordinates).
 
uint32_t texture_id
 The GPUDriver-specific texture ID (you should bind the texture using your custom GPUDriver implementation before drawing a quad).
 
uint32_t texture_width
 The texture width (in pixels).
 
uint32_t texture_height
 The texture height (in pixels).
 
BitmapFormat texture_format
 The pixel format of the texture.
 
Rect uv_coords
 UV coordinates of the texture (this is needed because the texture may be padded).
 
uint32_t render_buffer_id
 The GPUDriver-specific render buffer ID.
 

Constructor & Destructor Documentation

◆ RenderTarget()

Member Data Documentation

◆ height

uint32_t height

The viewport height (in device coordinates).

◆ is_empty

bool is_empty

Whether this target is empty (null texture)

◆ render_buffer_id

uint32_t render_buffer_id

The GPUDriver-specific render buffer ID.

◆ texture_format

BitmapFormat texture_format

The pixel format of the texture.

◆ texture_height

uint32_t texture_height

The texture height (in pixels).

This may be padded.

◆ texture_id

uint32_t texture_id

The GPUDriver-specific texture ID (you should bind the texture using your custom GPUDriver implementation before drawing a quad).

◆ texture_width

uint32_t texture_width

The texture width (in pixels).

This may be padded.

◆ uv_coords

Rect uv_coords

UV coordinates of the texture (this is needed because the texture may be padded).

◆ width

uint32_t width

The viewport width (in device coordinates).


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