From ca5e8fa0736d726ebd378d4106c8d179231ef931 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Mon, 9 Nov 2015 13:59:06 -0800 Subject: [PATCH] Adding a way to get an hmodule. --- src/xenia/ui/window.h | 2 ++ src/xenia/ui/window_win.cc | 4 ++++ src/xenia/ui/window_win.h | 1 + 3 files changed, 7 insertions(+) diff --git a/src/xenia/ui/window.h b/src/xenia/ui/window.h index 38e704947..76e6c45c1 100644 --- a/src/xenia/ui/window.h +++ b/src/xenia/ui/window.h @@ -24,6 +24,7 @@ namespace xe { namespace ui { +typedef void* NativePlatformHandle; typedef void* NativeWindowHandle; class Window { @@ -33,6 +34,7 @@ class Window { virtual ~Window(); Loop* loop() const { return loop_; } + virtual NativePlatformHandle native_platform_handle() const = 0; virtual NativeWindowHandle native_handle() const = 0; MenuItem* main_menu() const { return main_menu_.get(); } diff --git a/src/xenia/ui/window_win.cc b/src/xenia/ui/window_win.cc index e741144f1..7ef3f1259 100644 --- a/src/xenia/ui/window_win.cc +++ b/src/xenia/ui/window_win.cc @@ -33,6 +33,10 @@ Win32Window::~Win32Window() { } } +NativePlatformHandle Win32Window::native_platform_handle() const { + return ::GetModuleHandle(nullptr); +} + bool Win32Window::Initialize() { return OnCreate(); } bool Win32Window::OnCreate() { diff --git a/src/xenia/ui/window_win.h b/src/xenia/ui/window_win.h index 791545f37..0f34f6e28 100644 --- a/src/xenia/ui/window_win.h +++ b/src/xenia/ui/window_win.h @@ -26,6 +26,7 @@ class Win32Window : public Window { Win32Window(Loop* loop, const std::wstring& title); ~Win32Window() override; + NativePlatformHandle native_platform_handle() const override; NativeWindowHandle native_handle() const override { return hwnd_; } HWND hwnd() const { return hwnd_; }