Files
2026-04-17 20:09:41 +03:00

40 lines
941 B
C++

#pragma once
// Native UI runtime - Win32 surface abstraction
// Part of the AC6 Recompilation native presenter/window layer
#include <cstdint>
#include <memory>
#include <native/ui/surface.h>
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <windows.h>
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