// Draws a captured frame texture into the current render target as a letterboxed // full-screen image (aspect-preserved; the cleared background fills the bars). #pragma once #include #include #include namespace coop { class FrameRenderer { public: bool init(ID3D11Device* device); // Draws `srv` (a srcW x srcH image) centered and scaled to fit within a // dstW x dstH target. Sets its own viewport; callers that draw afterwards // (e.g. ImGui) should restore theirs. void draw(ID3D11DeviceContext* ctx, ID3D11ShaderResourceView* srv, std::uint32_t src_w, std::uint32_t src_h, std::uint32_t dst_w, std::uint32_t dst_h); private: Microsoft::WRL::ComPtr vs_; Microsoft::WRL::ComPtr ps_; Microsoft::WRL::ComPtr sampler_; }; } // namespace coop