#pragma once // Native UI runtime - Win32 surface abstraction // Part of the AC6 Recompilation native presenter/window layer #include #include #include #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #ifndef NOMINMAX #define NOMINMAX #endif #include namespace rex { namespace ui { #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_GAMES) class Win32HwndSurface final : public Surface { public: explicit Win32HwndSurface(HINSTANCE hinstance, HWND hwnd) : hinstance_(hinstance), hwnd_(hwnd) {} TypeIndex GetType() const override { return kTypeIndex_Win32Hwnd; } HINSTANCE hinstance() const { return hinstance_; } HWND hwnd() const { return hwnd_; } protected: bool GetSizeImpl(uint32_t& width_out, uint32_t& height_out) const override; private: HINSTANCE hinstance_; HWND hwnd_; }; #endif } // namespace ui } // namespace rex