Sign in to follow this  

ID3D10Device creation failure in release mode

This topic is 2047 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

My ID3D10Device creation works fine in debug mode but I throws an error in release mode:

[CODE]
DXGI_SWAP_CHAIN_DESC scDesc;
scDesc.BufferDesc.Width = desc.width;
scDesc.BufferDesc.Height = desc.height;
scDesc.BufferDesc.RefreshRate.Numerator = 60;
scDesc.BufferDesc.RefreshRate.Denominator = 1;
scDesc.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
scDesc.BufferDesc.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED;
scDesc.BufferDesc.Scaling = DXGI_MODE_SCALING_UNSPECIFIED;

scDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
scDesc.BufferCount = 1;
scDesc.OutputWindow = desc.hWnd;
scDesc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD;
scDesc.Flags = 0;

scDesc.Windowed = true;
scDesc.SampleDesc.Count = desc.sampleCount;
scDesc.SampleDesc.Quality = desc.sampleQuality;

// Create the device.
UINT createDeviceFlags = 0;
#if defined(DEBUG) || defined(_DEBUG)
createDeviceFlags |= D3D10_CREATE_DEVICE_DEBUG;
#endif

HRESULT hr;
hr = D3D10CreateDeviceAndSwapChain(
nullptr,
D3D10_DRIVER_TYPE_HARDWARE,
NULL,
createDeviceFlags,
D3D10_SDK_VERSION,
&scDesc,
&g_Renderer.m_DxCore.pSwapChain,
&g_Renderer.m_DxCore.pDevice);


//////RUNTIME ERROR HANDLING
if(FAILED(hr)) {
throw std::runtime_error("ERROR: Failed to create ID3D10Device and IDXGISwapChain");
}[/CODE]

I've already checked each of these options, but none of it triggers.
http://msdn.microsoft.com/en-us/library/windows/desktop/bb205278(v=vs.85).aspx

The value of the hr seems to be -2005270527, after checking it with [CODE]std::cout<<hr[/CODE]
My debugger also can't show the value of hr when hovering over it, for some reason. :(

What could the problem possibly be?

Share this post


Link to post
Share on other sites

This topic is 2047 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this