docs
Loading...
Searching...
No Matches
RenderTarget.h
Go to the documentation of this file.
1///
2/// Copyright (C) 2026 Ultralight, Inc. All rights reserved.
3/// A license is required for commercial use. https://ultralig.ht
4///
5#pragma once
7#include <Ultralight/Bitmap.h>
9
10namespace ultralight {
11
12#pragma pack(push, 1)
13
14///
15/// Offscreen render target, used when rendering Views via the GPU renderer.
16///
17/// When a View is rendered via the GPU renderer (see View::is_accelerated), it will be rendered to
18/// an offscreen render target (View::render_target) that you can display in your application.
19///
20/// This is intended to be used with a custom GPUDriver implementation in a game or similar
21/// application.
22///
23/// ## Displaying the Render Target
24///
25/// To display the View's render target, you should:
26///
27/// 1. Retrieve the underlying texture via RenderTarget::texture_id().
28/// 2. Bind the texture using your custom GPUDriver implementation.
29/// 3. Draw a textured quad with the provided UV coordinates (RenderTarget::uv_coords()).
30///
32 ///
33 /// Whether this target is empty (null texture)
34 ///
36
37 ///
38 /// The viewport width (in device coordinates).
39 ///
40 uint32_t width;
41
42 ///
43 /// The viewport height (in device coordinates).
44 ///
45 uint32_t height;
46
47 ///
48 /// The GPUDriver-specific texture ID (you should bind the texture using your custom GPUDriver
49 /// implementation before drawing a quad).
50 ///
51 uint32_t texture_id;
52
53 ///
54 /// The texture width (in pixels). This may be padded.
55 ///
56 uint32_t texture_width;
57
58 ///
59 /// The texture height (in pixels). This may be padded.
60 ///
62
63 ///
64 /// The pixel format of the texture.
65 ///
67
68 ///
69 /// UV coordinates of the texture (this is needed because the texture may be padded).
70 ///
72
73 ///
74 /// The GPUDriver-specific render buffer ID.
75 ///
77
79};
80
81#pragma pack(pop)
82
83} // namespace ultralight
#define UExport
Definition Exports.h:22
Root namespace for every public Ultralight type, function, and enumeration.
BitmapFormat
The various Bitmap formats.
Definition Bitmap.h:16
Float Rectangle Helper.
Definition Geometry.h:416
Rect uv_coords
UV coordinates of the texture (this is needed because the texture may be padded).
Definition RenderTarget.h:71
uint32_t texture_id
The GPUDriver-specific texture ID (you should bind the texture using your custom GPUDriver implementa...
Definition RenderTarget.h:51
uint32_t width
The viewport width (in device coordinates).
Definition RenderTarget.h:40
uint32_t render_buffer_id
The GPUDriver-specific render buffer ID.
Definition RenderTarget.h:76
BitmapFormat texture_format
The pixel format of the texture.
Definition RenderTarget.h:66
uint32_t height
The viewport height (in device coordinates).
Definition RenderTarget.h:45
bool is_empty
Whether this target is empty (null texture).
Definition RenderTarget.h:35
uint32_t texture_height
The texture height (in pixels).
Definition RenderTarget.h:61
uint32_t texture_width
The texture width (in pixels).
Definition RenderTarget.h:56