diff options
Diffstat (limited to '3rdparty/bgfx/examples/common/entry/entry_winrt.cx')
-rw-r--r-- | 3rdparty/bgfx/examples/common/entry/entry_winrt.cx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/3rdparty/bgfx/examples/common/entry/entry_winrt.cx b/3rdparty/bgfx/examples/common/entry/entry_winrt.cx index 796d1f64f48..db90098cec0 100644 --- a/3rdparty/bgfx/examples/common/entry/entry_winrt.cx +++ b/3rdparty/bgfx/examples/common/entry/entry_winrt.cx @@ -9,6 +9,7 @@ #include <bgfx/bgfxplatform.h> #include <bx/thread.h> +#include <Unknwn.h> using namespace Windows::ApplicationModel; using namespace Windows::ApplicationModel::Core; @@ -26,6 +27,18 @@ static char* g_emptyArgs[] = { "" }; static entry::WindowHandle g_defaultWindow = { 0 }; static entry::EventQueue g_eventQueue; +/// +inline void winrtSetWindow(::IUnknown* _window) +{ + bgfx::PlatformData pd; + pd.ndt = NULL; + pd.nwh = _window; + pd.context = NULL; + pd.backBuffer = NULL; + pd.backBufferDS = NULL; + bgfx::setPlatformData(pd); +} + ref class App sealed : public IFrameworkView { public: @@ -56,7 +69,7 @@ public: window->Closed += ref new TypedEventHandler<CoreWindow^, CoreWindowEventArgs^>(this, &App::OnWindowClosed); - bgfx::winrtSetWindow(reinterpret_cast<IUnknown*>(window) ); + winrtSetWindow(reinterpret_cast<IUnknown*>(window) ); } virtual void Load(String^ entryPoint) |