rexglue-skate3/include/rex/ui/surface_win.h
2026-05-18 22:41:13 +01:00

47 lines
1.3 KiB
C++

#pragma once
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2021 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*
* @modified Tom Clay, 2026 - Adapted for ReXGlue runtime
*/
#include <cstdint>
#include <memory>
#include <rex/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