Ultralight C++ API 1.3.0
Loading...
Searching...
No Matches
ultralight::GPUDriver Class Referenceabstract

#include <Ultralight/platform/GPUDriver.h>

Details

User-defined GPU driver interface.

The library uses this to optionally render Views directly on the GPU.

Precondition
Only used if the View is accelerated (see ViewConfig::is_accelerated)

This is automatically provided for you when you use App::Create(), AppCore provides platform-specific implementations of GPUDriver for each OS.

If you are using Renderer::Create(), you will need to provide your own implementation of this class if you have enabled the GPU renderer in the Config.

See also
Platform::set_gpu_driver()

Public Member Functions

virtual ~GPUDriver ()
 
virtual void BeginSynchronize ()=0
 Called before any commands are dispatched during a frame.
 
virtual void EndSynchronize ()=0
 Called after any commands are dispatched during a frame.
 
virtual uint32_t NextTextureId ()=0
 Get the next available texture ID.
 
virtual void CreateTexture (uint32_t texture_id, RefPtr< Bitmap > bitmap)=0
 Create a texture with a certain ID and optional bitmap.
 
virtual void UpdateTexture (uint32_t texture_id, RefPtr< Bitmap > bitmap)=0
 Update an existing non-RTT texture with new bitmap data.
 
virtual void DestroyTexture (uint32_t texture_id)=0
 Destroy a texture.
 
virtual uint32_t NextRenderBufferId ()=0
 Generate the next available render buffer ID.
 
virtual void CreateRenderBuffer (uint32_t render_buffer_id, const RenderBuffer &buffer)=0
 Create a render buffer with certain ID and buffer description.
 
virtual void DestroyRenderBuffer (uint32_t render_buffer_id)=0
 Destroy a render buffer.
 
virtual uint32_t NextGeometryId ()=0
 Generate the next available geometry ID.
 
virtual void CreateGeometry (uint32_t geometry_id, const VertexBuffer &vertices, const IndexBuffer &indices)=0
 Create geometry with certain ID and vertex/index data.
 
virtual void UpdateGeometry (uint32_t geometry_id, const VertexBuffer &vertices, const IndexBuffer &indices)=0
 Update existing geometry with new vertex/index data.
 
virtual void DestroyGeometry (uint32_t geometry_id)=0
 Destroy geometry.
 
virtual void UpdateCommandList (const CommandList &list)=0
 Update command list (you should copy the commands to your own structure).
 

Constructor & Destructor Documentation

◆ ~GPUDriver()

virtual ultralight::GPUDriver::~GPUDriver ( )
virtual

Member Function Documentation

◆ BeginSynchronize()

virtual void ultralight::GPUDriver::BeginSynchronize ( )
pure virtual

Called before any commands are dispatched during a frame.

◆ CreateGeometry()

virtual void ultralight::GPUDriver::CreateGeometry ( uint32_t  geometry_id,
const VertexBuffer vertices,
const IndexBuffer indices 
)
pure virtual

Create geometry with certain ID and vertex/index data.

◆ CreateRenderBuffer()

virtual void ultralight::GPUDriver::CreateRenderBuffer ( uint32_t  render_buffer_id,
const RenderBuffer buffer 
)
pure virtual

Create a render buffer with certain ID and buffer description.

◆ CreateTexture()

virtual void ultralight::GPUDriver::CreateTexture ( uint32_t  texture_id,
RefPtr< Bitmap bitmap 
)
pure virtual

Create a texture with a certain ID and optional bitmap.

NOTE: If the Bitmap is empty (Bitmap::IsEmpty), then a RTT Texture should be created instead. This will be used as a backing texture for a new RenderBuffer.

◆ DestroyGeometry()

virtual void ultralight::GPUDriver::DestroyGeometry ( uint32_t  geometry_id)
pure virtual

Destroy geometry.

◆ DestroyRenderBuffer()

virtual void ultralight::GPUDriver::DestroyRenderBuffer ( uint32_t  render_buffer_id)
pure virtual

Destroy a render buffer.

◆ DestroyTexture()

virtual void ultralight::GPUDriver::DestroyTexture ( uint32_t  texture_id)
pure virtual

Destroy a texture.

◆ EndSynchronize()

virtual void ultralight::GPUDriver::EndSynchronize ( )
pure virtual

Called after any commands are dispatched during a frame.

◆ NextGeometryId()

virtual uint32_t ultralight::GPUDriver::NextGeometryId ( )
pure virtual

Generate the next available geometry ID.

◆ NextRenderBufferId()

virtual uint32_t ultralight::GPUDriver::NextRenderBufferId ( )
pure virtual

Generate the next available render buffer ID.

◆ NextTextureId()

virtual uint32_t ultralight::GPUDriver::NextTextureId ( )
pure virtual

Get the next available texture ID.

◆ UpdateCommandList()

virtual void ultralight::GPUDriver::UpdateCommandList ( const CommandList list)
pure virtual

Update command list (you should copy the commands to your own structure).

◆ UpdateGeometry()

virtual void ultralight::GPUDriver::UpdateGeometry ( uint32_t  geometry_id,
const VertexBuffer vertices,
const IndexBuffer indices 
)
pure virtual

Update existing geometry with new vertex/index data.

◆ UpdateTexture()

virtual void ultralight::GPUDriver::UpdateTexture ( uint32_t  texture_id,
RefPtr< Bitmap bitmap 
)
pure virtual

Update an existing non-RTT texture with new bitmap data.


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