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

#include <screenshot.h>

Public Member Functions

ID3D12CommandList * Record (ID3D12Resource *backBuffer)
std::expected< void, std::string > WriteBmp (const fs::path &path) const

Static Public Member Functions

static std::expected< ScreenshotCapture, std::string > Create (ID3D12Device *device, ID3D12Resource *backBuffer)

Private Member Functions

 ScreenshotCapture ()=default

Private Attributes

ComPtr< ID3D12CommandAllocator > m_allocator
ComPtr< ID3D12GraphicsCommandList > m_list
ComPtr< ID3D12Resource > m_readback
D3D12_PLACED_SUBRESOURCE_FOOTPRINT m_footprint {}
uint32_t m_width = 0
uint32_t m_height = 0

Detailed Description

Definition at line 18 of file screenshot.h.

Constructor & Destructor Documentation

◆ ScreenshotCapture()

bicameral::render::ScreenshotCapture::ScreenshotCapture ( )
privatedefault

Referenced by Create().

Here is the caller graph for this function:

Member Function Documentation

◆ Create()

std::expected< ScreenshotCapture, std::string > bicameral::render::ScreenshotCapture::Create ( ID3D12Device * device,
ID3D12Resource * backBuffer )
staticnodiscard

Definition at line 53 of file screenshot.cpp.

References bicameral::gpu::CreateBuffer(), m_allocator, m_footprint, m_height, m_list, m_readback, m_width, bicameral::gpu::Readback, and ScreenshotCapture().

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

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

◆ Record()

ID3D12CommandList * bicameral::render::ScreenshotCapture::Record ( ID3D12Resource * backBuffer)
nodiscard

Definition at line 81 of file screenshot.cpp.

References m_allocator, m_footprint, m_list, m_readback, and bicameral::gpu::Transition().

Here is the call graph for this function:

◆ WriteBmp()

std::expected< void, std::string > bicameral::render::ScreenshotCapture::WriteBmp ( const fs::path & path) const
nodiscard

Definition at line 103 of file screenshot.cpp.

References m_footprint, m_height, m_readback, m_width, and bicameral::ToUtf8().

Here is the call graph for this function:

Member Data Documentation

◆ m_allocator

ComPtr<ID3D12CommandAllocator> bicameral::render::ScreenshotCapture::m_allocator
private

Definition at line 34 of file screenshot.h.

Referenced by Create(), and Record().

◆ m_footprint

D3D12_PLACED_SUBRESOURCE_FOOTPRINT bicameral::render::ScreenshotCapture::m_footprint {}
private

Definition at line 39 of file screenshot.h.

Referenced by Create(), Record(), and WriteBmp().

◆ m_height

uint32_t bicameral::render::ScreenshotCapture::m_height = 0
private

Definition at line 41 of file screenshot.h.

Referenced by Create(), and WriteBmp().

◆ m_list

ComPtr<ID3D12GraphicsCommandList> bicameral::render::ScreenshotCapture::m_list
private

Definition at line 35 of file screenshot.h.

Referenced by Create(), and Record().

◆ m_readback

ComPtr<ID3D12Resource> bicameral::render::ScreenshotCapture::m_readback
private

Definition at line 38 of file screenshot.h.

Referenced by Create(), Record(), and WriteBmp().

◆ m_width

uint32_t bicameral::render::ScreenshotCapture::m_width = 0
private

Definition at line 40 of file screenshot.h.

Referenced by Create(), and WriteBmp().


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