Photon Editor Library 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ImguiRenderContent.h
Go to the documentation of this file.
1#pragma once
2
4#include "editor_lib_config.h"
5
7
8#include <Utility/Concurrent/TSPSCRingBuffer.h>
9
10#include <array>
11#include <cstddef>
12#include <vector>
13
14namespace ph::editor::render
15{
16
18{
19public:
20 // All data required by IMGUI to render a frame.
22 {
23 ImDrawData drawData;
24 std::vector<ImDrawList> drawListBuffer;
25 std::vector<ImDrawList*> drawListPtrBuffer;
26 ImGuiViewport ownerViewportBuffer;
27
28 void copyFrom(const ImDrawData& srcDrawData);
29 };
30
39 using SharedRenderData = TSPSCRingBuffer<
42
43public:
45
46 void update(const RenderThreadUpdateContext& ctx) override;
47 void createGHICommands(GHIThreadCaller& caller) override;
48 void setupGHI(GHIThreadCaller& caller) override;
49 void cleanupGHI(GHIThreadCaller& caller) override;
50 EProcessOrder getProcessOrder() const override;
51
52 /*
53 Can only be called during render update and command generation (on main thread).
54 */
56
58
59private:
74 SharedRenderData m_sharedRenderData;
75
76 int m_numAvailableRenderData;
77};
78
83
84}// end namespace ph::editor::render
Thin wrapper for GHI thread interactions from another thread. Mainly to hide unrelated GHI interface ...
Definition GHIThreadCaller.h:16
Definition RenderThreadUpdateContext.h:11
Definition IDynamicSceneResource.h:20
Definition ImguiRenderContent.h:18
void update(const RenderThreadUpdateContext &ctx) override
Definition ImguiRenderContent.cpp:27
SharedRenderData & getSharedRenderData()
Definition ImguiRenderContent.cpp:78
ImguiRenderContent()
Definition ImguiRenderContent.cpp:19
TSPSCRingBuffer< ImguiRenderData, config::NUM_RENDER_THREAD_BUFFERED_FRAMES+1 > SharedRenderData
Definition ImguiRenderContent.h:39
EProcessOrder getProcessOrder() const override
Definition ImguiRenderContent.h:79
void signifyNewRenderDataIsAvailable()
Definition ImguiRenderContent.cpp:86
void cleanupGHI(GHIThreadCaller &caller) override
Definition ImguiRenderContent.cpp:75
void createGHICommands(GHIThreadCaller &caller) override
Definition ImguiRenderContent.cpp:32
void setupGHI(GHIThreadCaller &caller) override
Definition ImguiRenderContent.cpp:72
constexpr std::size_t NUM_RENDER_THREAD_BUFFERED_FRAMES
Definition editor_lib_config.h:10
Definition DesignerObject.h:19
EProcessOrder
Definition IDynamicSceneResource.h:11
void copyFrom(const ImDrawData &srcDrawData)
Definition ImguiRenderContent.cpp:93
ImGuiViewport ownerViewportBuffer
Definition ImguiRenderContent.h:26
ImDrawData drawData
Definition ImguiRenderContent.h:23
std::vector< ImDrawList > drawListBuffer
Definition ImguiRenderContent.h:24
std::vector< ImDrawList * > drawListPtrBuffer
Definition ImguiRenderContent.h:25