Nebula
Loading...
Searching...
No Matches
ultralightrenderer.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
9//------------------------------------------------------------------------------
10#include "core/types.h"
11#include "util/hashtable.h"
13#include "coregraphics/buffer.h"
15#include "coregraphics/pass.h"
16#include "Ultralight/Ultralight.h"
17#include "AppCore/Platform.h"
18namespace StaticUI
19{
20
21class UltralightRenderer : public ultralight::GPUDriver
22{
23public:
24
29
31 uint32_t NextTextureId() override;
33 void CreateTexture(uint32_t texture_id, ultralight::Ref<ultralight::Bitmap> bitmap) override;
35 void UpdateTexture(uint32_t texture_id, ultralight::Ref<ultralight::Bitmap> bitmap) override;
37 void DestroyTexture(uint32_t texture_id) override;
38
40 uint32_t NextRenderBufferId() override;
42 void CreateRenderBuffer(uint32_t render_buffer_id, const ultralight::RenderBuffer& buffer) override;
44 void DestroyRenderBuffer(uint32_t render_buffer_id) override;
45
47 uint32_t NextGeometryId() override;
49 void CreateGeometry(uint32_t geometry_id,
50 const ultralight::VertexBuffer& vertices,
51 const ultralight::IndexBuffer& indices) override;
53 void UpdateGeometry(uint32_t geometry_id,
54 const ultralight::VertexBuffer& vertices,
55 const ultralight::IndexBuffer& indices) override;
56
58 void DestroyGeometry(uint32_t geometry_id) override;
59
61 void UpdateCommandList(const ultralight::CommandList& list) override;
62
64 void BeginSynchronize() override;
66 void EndSynchronize() override;
67
69 void PreDraw(const ultralight::RenderTarget& view);
71 void Render(const CoreGraphics::CmdBufferId& cmds, IndexT bufferIndex);
72
74 void DrawToBackbuffer(const CoreGraphics::CmdBufferId& cmds, IndexT bufferIndex);
75
76private:
84
92
101
104};
105
106
107} // namespace StaticUI
Definition ultralightrenderer.h:22
void UpdateGeometry(uint32_t geometry_id, const ultralight::VertexBuffer &vertices, const ultralight::IndexBuffer &indices) override
Update geometry.
Definition ultralightrenderer.cc:378
Util::HashTable< uint, RenderBufferHandle > renderBufferMap
Definition ultralightrenderer.h:91
void CreateRenderBuffer(uint32_t render_buffer_id, const ultralight::RenderBuffer &buffer) override
Create render target.
Definition ultralightrenderer.cc:254
uint textureId
Definition ultralightrenderer.h:100
~UltralightRenderer()
Destructor.
Definition ultralightrenderer.cc:86
uint32_t NextTextureId() override
Get next texture.
Definition ultralightrenderer.cc:94
void EndSynchronize() override
End synchronization.
Definition ultralightrenderer.cc:463
uint geometryId
Definition ultralightrenderer.h:100
uint32_t NextRenderBufferId() override
Get next render buffer id.
Definition ultralightrenderer.cc:245
void CreateGeometry(uint32_t geometry_id, const ultralight::VertexBuffer &vertices, const ultralight::IndexBuffer &indices) override
Create geometry.
Definition ultralightrenderer.cc:330
Util::Array< ultralight::Command > commands
Definition ultralightrenderer.h:102
void UpdateCommandList(const ultralight::CommandList &list) override
Fill list of draw commands.
Definition ultralightrenderer.cc:445
void DrawToBackbuffer(const CoreGraphics::CmdBufferId &cmds, IndexT bufferIndex)
Render to screen.
Definition ultralightrenderer.cc:658
uint32_t NextGeometryId() override
Get next geometry.
Definition ultralightrenderer.cc:321
UltralightRenderer()
Constructor.
Definition ultralightrenderer.cc:31
Util::Array< uint > constantOffsets
Definition ultralightrenderer.h:103
friend uint GetTexture(UltralightRenderer *renderer, uint textureId)
Definition ultralightrenderer.cc:471
void CreateTexture(uint32_t texture_id, ultralight::Ref< ultralight::Bitmap > bitmap) override
Create texture.
Definition ultralightrenderer.cc:103
void DestroyTexture(uint32_t texture_id) override
Destroy texture.
Definition ultralightrenderer.cc:228
void BeginSynchronize() override
Begin synchronization.
Definition ultralightrenderer.cc:455
Util::HashTable< uint, TextureHandle > textureMap
Definition ultralightrenderer.h:83
void DestroyGeometry(uint32_t geometry_id) override
Destroy geometry.
Definition ultralightrenderer.cc:427
void UpdateTexture(uint32_t texture_id, ultralight::Ref< ultralight::Bitmap > bitmap) override
Update texture.
Definition ultralightrenderer.cc:162
Util::HashTable< uint, GeometryHandle > geometryMap
Definition ultralightrenderer.h:99
void Render(const CoreGraphics::CmdBufferId &cmds, IndexT bufferIndex)
Execute command lists.
Definition ultralightrenderer.cc:532
uint renderBufferId
Definition ultralightrenderer.h:100
void DestroyRenderBuffer(uint32_t render_buffer_id) override
Destroy render target.
Definition ultralightrenderer.cc:304
void PreDraw(const ultralight::RenderTarget &view)
Run through command lists and setup constants.
Definition ultralightrenderer.cc:486
Nebula's dynamic array class.
Definition array.h:60
Organizes key/value pairs by a hash code.
Definition hashtable.h:42
Static UI Context.
Definition staticuicontext.cc:13
ultralight::RefPtr< ultralight::View > view
Definition staticuicontext.cc:25
Definition buffer.h:23
Definition commandbuffer.h:155
Definition pass.h:28
texture type
Definition texture.h:25
Definition textureview.h:16
Definition vertexlayout.h:16
Definition ultralightrenderer.h:94
CoreGraphics::VertexLayoutId vlo
Definition ultralightrenderer.h:97
CoreGraphics::BufferId ibo
Definition ultralightrenderer.h:96
CoreGraphics::BufferId vbo
Definition ultralightrenderer.h:95
Definition ultralightrenderer.h:86
CoreGraphics::PassId pass
Definition ultralightrenderer.h:87
CoreGraphics::TextureViewId texView
Definition ultralightrenderer.h:89
Definition ultralightrenderer.h:79
CoreGraphics::TextureId tex
Definition ultralightrenderer.h:80
bool initial
Definition ultralightrenderer.h:81
unsigned int uint
Definition types.h:31
int IndexT
Definition types.h:48