I have a 3d d3d11 engine and I'd like to create 2d graphics from it as well.
Here's how I typically create the IDXGIFactory1
:
Microsoft::WRL::ComPtr<IDXGIFactory1> m_pFactory;
HRESULT hres = CreateDXGIFactory1( __uuidof( IDXGIFactory1 ), reinterpret_cast<void**>( m_pFactory.GetAddressOf() ) );
Here's how I typically create the ID2D1Factory
:
Microsoft::WRL::ComPtr<ID2D1Factory> m_pFactory;
HRESULT hres = D2D1CreateFactory( D2D1_FACTORY_TYPE_SINGLE_THREADED, __uuidof( ID2D1Factory1 ), &d2dOptions, &m_pFactory );
Is there a way to create an ID2D1Factory
given an already created IDXGIFactory1
?
My intention is to combine the 2d factory functions to draw 2d functions given the 3d engine, so I can use convenient 2d drawing functions like: DrawRectangle, DrawRoundedRectangle, drawEllipse, DrawText etc.
Thanks in advance.