Ultralight  1.0.0
A fast, lightweight, HTML UI engine for native apps.
ultralight::Renderer Class Referenceabstract

The core of Ultralight. More...

#include <Renderer.h>

Inheritance diagram for ultralight::Renderer:
ultralight::RefCounted

Public Member Functions

virtual Ref< ViewCreateView (uint32_t width, uint32_t height, bool transparent)=0
 Create a new View. More...
 
virtual void Update ()=0
 Update timers and dispatch internal callbacks. More...
 
virtual void Render ()=0
 Render all active views to display lists and dispatch calls to GPUDriver. More...
 
virtual void PurgeMemory ()=0
 Attempt to release as much memory as possible. More...
 

Static Public Member Functions

static Ref< RendererCreate ()
 Create the Renderer singleton. More...
 

Detailed Description

The core of Ultralight.

You should initialize it after setting up your Platform config and drivers.

This singleton class manages the lifetime of all Views (

See also
View) and coordinates all painting, rendering, network requests, and event dispatch.
Note
You don't have to create this instance directly if you use the AppCore API. The App class will automatically create a Renderer and perform all rendering within its run loop.
See also
App::Create

Definition at line 32 of file Renderer.h.

Member Function Documentation

◆ Create()

static Ref<Renderer> ultralight::Renderer::Create ( )
static

Create the Renderer singleton.

You should set up all your Platform config, file-system, and drivers before calling this function.

See also
Platform
Note
You should only create one Renderer per application lifetime.
Returns
Returns a ref-pointer to a new Renderer instance. You should assign it to either a Ref<Renderer> (non-nullable) or RefPtr<Renderer> (nullable).

◆ CreateView()

virtual Ref<View> ultralight::Renderer::CreateView ( uint32_t  width,
uint32_t  height,
bool  transparent 
)
pure virtual

Create a new View.

Parameters
widthThe initial width, in device coordinates.
heightThe initial height, in device coordinates.
transparentWhether or not the view background is transparent.
Returns
Returns a ref-pointer to a new View instance. You should assign it to either a Ref<View> (non-nullable) or RefPtr<View> (nullable).
Note
The device coordinates are scaled to pixels by multiplying them with the current DPI scale (
See also
Config::device_scale_hint) and rounding to the nearest integer value.

◆ PurgeMemory()

virtual void ultralight::Renderer::PurgeMemory ( )
pure virtual

Attempt to release as much memory as possible.

Don't call this from any callbacks or driver code.

◆ Render()

virtual void ultralight::Renderer::Render ( )
pure virtual

Render all active views to display lists and dispatch calls to GPUDriver.

Note
If you're using the default, offscreen GL driver, this updates the internal bitmap of each View (
See also
View::bitmap).

◆ Update()

virtual void ultralight::Renderer::Update ( )
pure virtual

Update timers and dispatch internal callbacks.

You should call this often from your main application loop.


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