Bicameral Engine
GPU-resident engine for a magic-research open-world game
Loading...
Searching...
No Matches
bicameral::editor::EditorOverlay Class Reference

#include <editor_overlay.h>

Collaboration diagram for bicameral::editor::EditorOverlay:
[legend]

Classes

struct  FrameSlot

Public Member Functions

 ~EditorOverlay ()
 EditorOverlay (const EditorOverlay &)=delete
EditorOverlay & operator= (const EditorOverlay &)=delete
 EditorOverlay (EditorOverlay &&)=delete
EditorOverlay & operator= (EditorOverlay &&)=delete
bool WantsPointer () const
bool WantsKeyboard () const
TimeRequest Build (const EditorStatus &status, const TimeControl &time)
bool Submit (gpu::Queue &direct, ID3D12Resource *backBuffer, D3D12_CPU_DESCRIPTOR_HANDLE renderTargetView)
LabPanel & Lab ()

Static Public Member Functions

static std::expected< std::unique_ptr< EditorOverlay >, std::string > Create (Window &window, ID3D12Device *device, gpu::Queue &direct, DXGI_FORMAT format, uint32_t frameCount)

Private Member Functions

 EditorOverlay (Window &window, uint32_t frameCount)
bool CreateGpuObjects (ID3D12Device *device, uint32_t frameCount)
bool InitializeBackends (ID3D12Device *device, gpu::Queue &direct, DXGI_FORMAT format)
void LoadJapaneseFont ()
TimeRequest BuildTimePanel (const EditorStatus &status, const TimeControl &time) const
uint64_t BuildRewind (const EditorStatus &status) const
void BuildStatusPanel (const EditorStatus &status) const
void BuildReactionTable (const ReactionTableStatus &table) const
TimeRequest TakeShortcuts (const TimeControl &time) const

Static Private Member Functions

static void AllocateDescriptor (::ImGui_ImplDX12_InitInfo *info, D3D12_CPU_DESCRIPTOR_HANDLE *cpuHandle, D3D12_GPU_DESCRIPTOR_HANDLE *gpuHandle)
static void FreeDescriptor (::ImGui_ImplDX12_InitInfo *info, D3D12_CPU_DESCRIPTOR_HANDLE cpuHandle, D3D12_GPU_DESCRIPTOR_HANDLE gpuHandle)

Private Attributes

Window & m_window
std::unique_ptr< LabPanel > m_lab
bool m_contextCreated = false
bool m_win32Initialized = false
bool m_dx12Initialized = false
std::vector< FrameSlot > m_frames
uint64_t m_submitCount = 0
ComPtr< ID3D12GraphicsCommandList > m_list
ComPtr< ID3D12DescriptorHeap > m_srvHeap
uint32_t m_srvIncrement = 0
std::vector< uint32_t > m_freeSrvSlots

Detailed Description

Definition at line 87 of file editor_overlay.h.

Constructor & Destructor Documentation

◆ ~EditorOverlay()

bicameral::editor::EditorOverlay::~EditorOverlay ( )

Definition at line 90 of file editor_overlay.cpp.

References m_contextCreated, m_dx12Initialized, m_win32Initialized, and m_window.

◆ EditorOverlay() [1/3]

bicameral::editor::EditorOverlay::EditorOverlay ( const EditorOverlay & )
delete

References EditorOverlay().

Referenced by AllocateDescriptor(), Create(), EditorOverlay(), EditorOverlay(), FreeDescriptor(), operator=(), and operator=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EditorOverlay() [2/3]

bicameral::editor::EditorOverlay::EditorOverlay ( EditorOverlay && )
delete

References EditorOverlay().

Here is the call graph for this function:

◆ EditorOverlay() [3/3]

bicameral::editor::EditorOverlay::EditorOverlay ( Window & window,
uint32_t frameCount )
private

Definition at line 58 of file editor_overlay.cpp.

References m_frames, and m_window.

Member Function Documentation

◆ AllocateDescriptor()

void bicameral::editor::EditorOverlay::AllocateDescriptor ( ::ImGui_ImplDX12_InitInfo * info,
D3D12_CPU_DESCRIPTOR_HANDLE * cpuHandle,
D3D12_GPU_DESCRIPTOR_HANDLE * gpuHandle )
staticprivate

Definition at line 169 of file editor_overlay.cpp.

References EditorOverlay().

Referenced by InitializeBackends().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Build()

TimeRequest bicameral::editor::EditorOverlay::Build ( const EditorStatus & status,
const TimeControl & time )
nodiscard

Definition at line 215 of file editor_overlay.cpp.

References bicameral::editor::BuildGraphPanel(), BuildStatusPanel(), BuildTimePanel(), bicameral::editor::EditorStatus::graph, m_lab, and TakeShortcuts().

Here is the call graph for this function:

◆ BuildReactionTable()

void bicameral::editor::EditorOverlay::BuildReactionTable ( const ReactionTableStatus & table) const
private

◆ BuildRewind()

uint64_t bicameral::editor::EditorOverlay::BuildRewind ( const EditorStatus & status) const
nodiscardprivate

Definition at line 282 of file editor_overlay.cpp.

References bicameral::editor::EditorStatus::rewindUnavailable, bicameral::editor::EditorStatus::saveIntervalTicks, and bicameral::editor::EditorStatus::savePointTicks.

Referenced by BuildTimePanel().

Here is the caller graph for this function:

◆ BuildStatusPanel()

◆ BuildTimePanel()

TimeRequest bicameral::editor::EditorOverlay::BuildTimePanel ( const EditorStatus & status,
const TimeControl & time ) const
nodiscardprivate

Definition at line 231 of file editor_overlay.cpp.

References BuildRewind(), bicameral::editor::TimeControl::Paused(), bicameral::editor::TimeRequest::resetSpeed, bicameral::editor::TimeRequest::rewindTick, bicameral::editor::TimeControl::Speed(), bicameral::editor::TimeRequest::speedSteps, bicameral::editor::TimeControl::SteppedTicks(), bicameral::editor::TimeRequest::stepTicks, bicameral::editor::EditorStatus::tick, bicameral::editor::TimeRequest::togglePause, and bicameral::editor::EditorStatus::unit.

Referenced by Build().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Create()

std::expected< std::unique_ptr< EditorOverlay >, std::string > bicameral::editor::EditorOverlay::Create ( Window & window,
ID3D12Device * device,
gpu::Queue & direct,
DXGI_FORMAT format,
uint32_t frameCount )
staticnodiscard

Definition at line 60 of file editor_overlay.cpp.

References EditorOverlay(), ImGui_ImplWin32_WndProcHandler(), bicameral::Info, bicameral::Log(), bicameral::Render, and bicameral::Window::SetMessageHook().

Referenced by bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::CreateEditor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateGpuObjects()

bool bicameral::editor::EditorOverlay::CreateGpuObjects ( ID3D12Device * device,
uint32_t frameCount )
nodiscardprivate

Definition at line 102 of file editor_overlay.cpp.

References m_frames, m_freeSrvSlots, m_list, m_srvHeap, and m_srvIncrement.

◆ FreeDescriptor()

void bicameral::editor::EditorOverlay::FreeDescriptor ( ::ImGui_ImplDX12_InitInfo * info,
D3D12_CPU_DESCRIPTOR_HANDLE cpuHandle,
D3D12_GPU_DESCRIPTOR_HANDLE gpuHandle )
staticprivate

Definition at line 183 of file editor_overlay.cpp.

References EditorOverlay().

Referenced by InitializeBackends().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitializeBackends()

bool bicameral::editor::EditorOverlay::InitializeBackends ( ID3D12Device * device,
gpu::Queue & direct,
DXGI_FORMAT format )
nodiscardprivate

Definition at line 127 of file editor_overlay.cpp.

References AllocateDescriptor(), FreeDescriptor(), m_dx12Initialized, m_frames, m_srvHeap, m_win32Initialized, m_window, and bicameral::gpu::Queue::Native().

Here is the call graph for this function:

◆ Lab()

LabPanel & bicameral::editor::EditorOverlay::Lab ( )
inlinenodiscard

Definition at line 112 of file editor_overlay.h.

References m_lab.

◆ LoadJapaneseFont()

void bicameral::editor::EditorOverlay::LoadJapaneseFont ( )
private

Definition at line 148 of file editor_overlay.cpp.

References bicameral::Log(), bicameral::Render, bicameral::ToUtf8(), and bicameral::Warning.

Here is the call graph for this function:

◆ operator=() [1/2]

EditorOverlay & bicameral::editor::EditorOverlay::operator= ( const EditorOverlay & )
delete

References EditorOverlay().

Here is the call graph for this function:

◆ operator=() [2/2]

EditorOverlay & bicameral::editor::EditorOverlay::operator= ( EditorOverlay && )
delete

References EditorOverlay().

Here is the call graph for this function:

◆ Submit()

bool bicameral::editor::EditorOverlay::Submit ( gpu::Queue & direct,
ID3D12Resource * backBuffer,
D3D12_CPU_DESCRIPTOR_HANDLE renderTargetView )
nodiscard

Definition at line 379 of file editor_overlay.cpp.

References bicameral::gpu::Queue::IsComplete(), m_frames, m_list, m_srvHeap, m_submitCount, bicameral::gpu::Queue::Submit(), bicameral::gpu::Transition(), and bicameral::gpu::Queue::WaitCpu().

Here is the call graph for this function:

◆ TakeShortcuts()

TimeRequest bicameral::editor::EditorOverlay::TakeShortcuts ( const TimeControl & time) const
nodiscardprivate

Definition at line 201 of file editor_overlay.cpp.

References bicameral::editor::TimeControl::Paused(), bicameral::editor::TimeRequest::stepTicks, bicameral::editor::TimeRequest::togglePause, and WantsKeyboard().

Referenced by Build().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WantsKeyboard()

bool bicameral::editor::EditorOverlay::WantsKeyboard ( ) const
nodiscard

Definition at line 196 of file editor_overlay.cpp.

Referenced by TakeShortcuts().

Here is the caller graph for this function:

◆ WantsPointer()

bool bicameral::editor::EditorOverlay::WantsPointer ( ) const
nodiscard

Definition at line 192 of file editor_overlay.cpp.

Member Data Documentation

◆ m_contextCreated

bool bicameral::editor::EditorOverlay::m_contextCreated = false
private

Definition at line 143 of file editor_overlay.h.

Referenced by ~EditorOverlay().

◆ m_dx12Initialized

bool bicameral::editor::EditorOverlay::m_dx12Initialized = false
private

Definition at line 145 of file editor_overlay.h.

Referenced by InitializeBackends(), and ~EditorOverlay().

◆ m_frames

std::vector<FrameSlot> bicameral::editor::EditorOverlay::m_frames
private

Definition at line 147 of file editor_overlay.h.

Referenced by CreateGpuObjects(), EditorOverlay(), InitializeBackends(), and Submit().

◆ m_freeSrvSlots

std::vector<uint32_t> bicameral::editor::EditorOverlay::m_freeSrvSlots
private

Definition at line 154 of file editor_overlay.h.

Referenced by CreateGpuObjects().

◆ m_lab

std::unique_ptr<LabPanel> bicameral::editor::EditorOverlay::m_lab
private

Definition at line 142 of file editor_overlay.h.

Referenced by Build(), and Lab().

◆ m_list

ComPtr<ID3D12GraphicsCommandList> bicameral::editor::EditorOverlay::m_list
private

Definition at line 149 of file editor_overlay.h.

Referenced by CreateGpuObjects(), and Submit().

◆ m_srvHeap

ComPtr<ID3D12DescriptorHeap> bicameral::editor::EditorOverlay::m_srvHeap
private

Definition at line 152 of file editor_overlay.h.

Referenced by CreateGpuObjects(), InitializeBackends(), and Submit().

◆ m_srvIncrement

uint32_t bicameral::editor::EditorOverlay::m_srvIncrement = 0
private

Definition at line 153 of file editor_overlay.h.

Referenced by CreateGpuObjects().

◆ m_submitCount

uint64_t bicameral::editor::EditorOverlay::m_submitCount = 0
private

Definition at line 148 of file editor_overlay.h.

Referenced by Submit().

◆ m_win32Initialized

bool bicameral::editor::EditorOverlay::m_win32Initialized = false
private

Definition at line 144 of file editor_overlay.h.

Referenced by InitializeBackends(), and ~EditorOverlay().

◆ m_window

Window& bicameral::editor::EditorOverlay::m_window
private

Definition at line 141 of file editor_overlay.h.

Referenced by EditorOverlay(), InitializeBackends(), and ~EditorOverlay().


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