デバイスの作成が成功した後
DXGI_SWAP_CHAIN_DESC sd;
sd.BufferDesc.Width = kClientWidth;
sd.BufferDesc.Height = kClientHeight;
sd.BufferDesc.RefreshRate.Numerator = 60;
sd.BufferDesc.RefreshRate.Denominator = 1;
sd.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
sd.BufferDesc.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED;
sd.BufferDesc.Scaling = DXGI_MODE_SCALING_UNSPECIFIED;
// No multisampling.
sd.SampleDesc.Count = 1;
sd.SampleDesc.Quality = 0;
sd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
sd.BufferCount = 1;
sd.OutputWindow = static_cast<HWND>(m_CreationParam.wnd);
sd.Windowed = true;
sd.SwapEffect = DXGI_SWAP_EFFECT_DISCARD;
sd.Flags = 0;
UINT createDeviceFlags = 0;
#if defined(DEBUG) || defined(_DEBUG)
createDeviceFlags |= D3D10_CREATE_DEVICE_DEBUG;
#endif
HRESULT hRes = D3D11CreateDeviceAndSwapChain(
NULL, //default adapter
D3D_DRIVER_TYPE_HARDWARE,
NULL,
createDeviceFlags,
NULL,
NULL,
D3D11_SDK_VERSION,
&sd,
&m_SwapChain,
&m_d3dDevice,
NULL,
&m_d3dDevCon);
if (FAILED(hRes))
{
m_SwapChain = NULL;
m_d3dDevice = NULL;
m_d3dDevCon = NULL;
assert(0 && "Failed to create Device and SwapChain");
}
RSGetState を呼び出すと、null ポインターが返されます
// Fill state
m_d3dDevCon->RSGetState(&m_RasterState);
m_RasterState->GetDesc(&m_rsDesc);
なにが問題ですか?