Merge fixes

This commit is contained in:
Lynix
2020-05-27 20:03:46 +02:00
parent 68208f5426
commit e0e7435c55
11 changed files with 48 additions and 40 deletions

View File

@@ -15,6 +15,6 @@ namespace Nz
void DummySurface::Destroy()
{
m_handle = nullptr;
m_handle = WindowHandle{};
}
}

View File

@@ -29,12 +29,21 @@ namespace Nz::GL
::ShowWindow(m_window.get(), FALSE);
return Create(baseContext, params, m_window.get(), shareContext);
m_deviceContext = ::GetDC(m_window.get());
if (!m_deviceContext)
{
NazaraError("failed to retrieve dummy window device context: " + Error::GetLastSystemError());
return false;
}
return CreateInternal(baseContext, params, shareContext);
}
bool WGLContext::Create(const WGLContext* baseContext, const ContextParams& params, WindowHandle window, const WGLContext* shareContext)
{
m_deviceContext = ::GetDC(static_cast<HWND>(window));
NazaraAssert(window.type == WindowManager::Windows, "expected Windows window");
m_deviceContext = ::GetDC(static_cast<HWND>(window.windows.window));
if (!m_deviceContext)
{
NazaraError("failed to retrieve window device context: " + Error::GetLastSystemError());