I am new to working with windows applications and c++. I am trying to create a D2D device from Dxgi surface of d3d11 device following this code "http://msdn.microsoft.com/en-us/library/windows/desktop/hh404272(v=vs.85).aspx" .
But HRESULT gr ( creating d2d device) gives me an error "E_INVALIDARG" though I followed the same steps as given.
Here is the code snippet. //m_device is already initialized
// Get DXGI device
IDXGIDevice* DxgiDevice = nullptr;
HRESULT hr = m_Device->QueryInterface(__uuidof(IDXGIDevice), reinterpret_cast<void**>(&DxgiDevice));
// create id2d21factory
ID2D1Factory1* m_d2dFactory=nullptr;
D2D1_FACTORY_OPTIONS options;
options.debugLevel= D2D1_DEBUG_LEVEL_NONE;
D2D1_FACTORY_TYPE factoryType = D2D1_FACTORY_TYPE_SINGLE_THREADED;
hr = D2D1CreateFactory(factoryType, __uuidof(ID2D1Factory1),&options, reinterpret_cast<void **> (&m_d2dFactory));
HRESULT gr= m_d2dFactory->CreateDevice(DxgiDevice, &m_d2dDevice );
This code doesn't give any errors while compiling or building solution in visual studio 2012. But giving me error while debugging. I am trying to insert this code in microsoft's desktop duplication sample code. I need to create a d2dbitmap source for my project
please help me with this.
Please let me know if further details are required.