directx - How to CreateSwapChainForHwnd -
in following code, device instance of comptr<id3d12device>
initialized d3d12createdevice
, getting failing hresult
. value 0x887a0001. appreciate ideas doing wrong.
dxgi_swap_chain_desc1 swapchaindesc = {}; swapchaindesc.width = 0; swapchaindesc.height = 0; swapchaindesc.format = dxgi_format_r8g8b8a8_unorm; swapchaindesc.stereo = false; swapchaindesc.sampledesc.count = 1; swapchaindesc.sampledesc.quality = 0; swapchaindesc.bufferusage = dxgi_usage_render_target_output; swapchaindesc.buffercount = 2; swapchaindesc.scaling = dxgi_scaling_none; swapchaindesc.swapeffect = dxgi_swap_effect_flip_discard; swapchaindesc.alphamode = dxgi_alpha_mode_straight; swapchaindesc.flags = 0; comptr<idxgiswapchain1> swapchain; throwiffailed(factory->createswapchainforhwnd(device.get(), wnd.handle(), &swapchaindesc, nullptr, nullptr, &swapchain));
the first parameter createswapchain functions supposed id3d12commandqueue* rather graphics device.
also, set alphamode dxgi_alpha_mode_unspecified.
Comments
Post a Comment