// Owns the video-mirror pipeline (WGC capture + frame renderer) and its UI. // The target window comes from the injected hook's reported game HWND. #pragma once #include #include #include #include "capture/frame_renderer.hpp" #include "capture/window_capture.hpp" #include "ui/app_chrome.hpp" namespace coop { class CapturePanel { public: bool init(ID3D11Device* device); // The window to mirror (0 if none yet); typically the injected game's HWND. void set_target(HWND target) { target_ = target; } // `stats` are the host's render frame-timing, drawn as the mirror's // frametime / FPS graphs (this window is what the mirror renders into). void draw_ui(const FrameStats& stats); // Render thread: draw the mirrored frame as the window background. void render(ID3D11DeviceContext* ctx, std::uint32_t dst_w, std::uint32_t dst_h); private: void draw_perf_graphs(const FrameStats& stats); ID3D11Device* device_ = nullptr; FrameRenderer renderer_; WindowCapture capture_; HWND target_ = nullptr; bool enabled_ = false; }; } // namespace coop