Key node 1: move main-window UI presentation onto the D3D12 render loop with native UI renderer, text system, and texture host. Key node 2: wire frame timing/FPS display, window runtime, swapchain presentation, and native screenshot capture around the new path. Key node 3: carry editor shell/workspace/viewport/panel interaction updates needed by the new renderer and detached window flow. Key node 4: pump async resource loads and scene bridge follow-up needed for scene content visibility in new_editor.
55 lines
1.4 KiB
C++
55 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#ifndef NOMINMAX
|
|
#define NOMINMAX
|
|
#endif
|
|
|
|
#include <XCEngine/UI/DrawData.h>
|
|
|
|
#include <cstdint>
|
|
#include <filesystem>
|
|
#include <string>
|
|
#include <string_view>
|
|
|
|
namespace XCEngine::UI::Editor::Host {
|
|
|
|
class NativeRenderer;
|
|
class D3D12WindowRenderer;
|
|
|
|
class AutoScreenshotController {
|
|
public:
|
|
void Initialize(const std::filesystem::path& captureRoot);
|
|
void Shutdown();
|
|
|
|
void RequestCapture(std::string reason);
|
|
void CaptureIfRequested(
|
|
NativeRenderer& renderer,
|
|
D3D12WindowRenderer& windowRenderer,
|
|
const ::XCEngine::UI::UIDrawData& drawData,
|
|
unsigned int width,
|
|
unsigned int height,
|
|
bool framePresented);
|
|
|
|
bool HasPendingCapture() const;
|
|
const std::filesystem::path& GetLatestCapturePath() const;
|
|
const std::string& GetLastCaptureSummary() const;
|
|
const std::string& GetLastCaptureError() const;
|
|
|
|
private:
|
|
std::filesystem::path BuildHistoryCapturePath(std::string_view reason) const;
|
|
|
|
static std::string BuildTimestampString();
|
|
static std::string SanitizeReason(std::string_view reason);
|
|
|
|
std::filesystem::path m_captureRoot = {};
|
|
std::filesystem::path m_historyRoot = {};
|
|
std::filesystem::path m_latestCapturePath = {};
|
|
std::string m_pendingReason = {};
|
|
std::string m_lastCaptureSummary = {};
|
|
std::string m_lastCaptureError = {};
|
|
std::uint64_t m_captureCount = 0;
|
|
bool m_capturePending = false;
|
|
};
|
|
|
|
} // namespace XCEngine::UI::Editor::Host
|