Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/Microsoft/Silk.NET.DXGI/NativeWindowExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,23 @@ public static unsafe int CreateDxgiSwapchain
IDXGISwapChain1** ppSwapChain
)
{
if (window.Win32.HasValue)
{
return factory->CreateSwapChainForHwnd
(pDevice, window.Win32.Value.Hwnd, pDesc, pFullscreenDesc, pRestrictToOutput, ppSwapChain);
}

if (window.WinRT.HasValue)
{
return factory->CreateSwapChainForCoreWindow
(pDevice, (IUnknown*) window.WinRT.Value, pDesc, pRestrictToOutput, ppSwapChain);
}

if (window.DXHandle.HasValue)
{
return factory->CreateSwapChainForHwnd
(pDevice, window.DXHandle.Value, pDesc, pFullscreenDesc, pRestrictToOutput, ppSwapChain);
}

Throw();
return -1;

static void Throw() => throw new InvalidOperationException
("The given window is neither a Win32 window nor a WinRT CoreWindow");
("The given window has neither a valid DXHandle nor a valid WinRT CoreWindow.");
}

public static unsafe int CreateDxgiSwapchain
Expand Down