/// <summary> /// <p>Creates a factory object that can be used to create Direct2D resources.</p> /// </summary> /// <param name = "factoryType"><dd> <p>The threading model of the factory and the resources it creates.</p> </dd></param> /// <param name = "riid"><dd> <p>A reference to the IID of <strong><see cref = "SharpDX.Direct2D1.Factory"/></strong> that is obtained by using __uuidof(<see cref = "SharpDX.Direct2D1.Factory"/>).</p> </dd></param> /// <param name = "factoryOptionsRef"><dd> <p>The level of detail provided to the debugging layer.</p> </dd></param> /// <param name = "iFactoryOut"><dd> <p>When this method returns, contains the address to a reference to the new factory.</p> </dd></param> /// <returns><p>If this function succeeds, it returns <strong><see cref = "SharpDX.Result.Ok"/></strong>. Otherwise, it returns an <strong><see cref = "SharpDX.Result"/></strong> error code.</p></returns> /// <remarks> /// <p>The <strong><see cref = "SharpDX.Direct2D1.Factory"/></strong> interface provides the starting point for Direct2D. In general, objects created from a single instance of a factory object can be used with other resources created from that instance, but not with resources created by other factory instances. </p> /// </remarks> /// <doc-id>dd368034</doc-id> /// <unmanaged>HRESULT D2D1CreateFactory([In] D2D1_FACTORY_TYPE factoryType,[In] const GUID& riid,[In, Optional] const D2D1_FACTORY_OPTIONS* pFactoryOptions,[Out] void** ppIFactory)</unmanaged> /// <unmanaged-short>D2D1CreateFactory</unmanaged-short> public static unsafe void CreateFactory(SharpDX.Direct2D1.FactoryType factoryType, System.Guid riid, SharpDX.Direct2D1.FactoryOptions?factoryOptionsRef, out System.IntPtr iFactoryOut) { SharpDX.Direct2D1.FactoryOptions factoryOptionsRef_; SharpDX.Result __result__; if (factoryOptionsRef != null) { factoryOptionsRef_ = factoryOptionsRef.Value; fixed(void *iFactoryOut_ = &iFactoryOut) __result__ = D2D1CreateFactory_(unchecked ((System.Int32)factoryType), &riid, factoryOptionsRef == null ? (void *)0 : &factoryOptionsRef_, iFactoryOut_); __result__.CheckError(); }
/// <summary> /// <p>Creates a factory object that can be used to create Direct2D resources.</p> /// </summary> /// <param name="factoryType"><dd> <p>The threading model of the factory and the resources it creates.</p> </dd></param> /// <param name="riid"><dd> <p>A reference to the IID of <strong><see cref="SharpDX.Direct2D1.Factory"/></strong> that is obtained by using __uuidof(<see cref="SharpDX.Direct2D1.Factory"/>).</p> </dd></param> /// <param name="factoryOptionsRef"><dd> <p>The level of detail provided to the debugging layer.</p> </dd></param> /// <param name="iFactoryOut"><dd> <p>When this method returns, contains the address to a reference to the new factory.</p> </dd></param> /// <returns><p>If this function succeeds, it returns <strong><see cref="SharpDX.Result.Ok"/></strong>. Otherwise, it returns an <strong><see cref="SharpDX.Result"/></strong> error code.</p></returns> /// <remarks> /// <p>The <strong><see cref="SharpDX.Direct2D1.Factory"/></strong> interface provides the starting point for Direct2D. In general, objects created from a single instance of a factory object can be used with other resources created from that instance, but not with resources created by other factory instances. </p><p><strong>Windows Phone 8.1:</strong> This API is supported.</p> /// </remarks> /// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='D2D1CreateFactory']/*"/> /// <msdn-id>dd368034</msdn-id> /// <unmanaged>HRESULT D2D1CreateFactory([In] D2D1_FACTORY_TYPE factoryType,[In] const GUID& riid,[In, Optional] const D2D1_FACTORY_OPTIONS* pFactoryOptions,[Out] void** ppIFactory)</unmanaged> /// <unmanaged-short>D2D1CreateFactory</unmanaged-short> public static void CreateFactory(SharpDX.Direct2D1.FactoryType factoryType, System.Guid riid, SharpDX.Direct2D1.FactoryOptions?factoryOptionsRef, out System.IntPtr iFactoryOut) { unsafe { SharpDX.Direct2D1.FactoryOptions factoryOptionsRef_; if (factoryOptionsRef.HasValue) { factoryOptionsRef_ = factoryOptionsRef.Value; } SharpDX.Result __result__; fixed(void *iFactoryOut_ = &iFactoryOut) __result__ = D2D1CreateFactory_(unchecked ((int)factoryType), &riid, (factoryOptionsRef.HasValue)?&factoryOptionsRef_:(void *)IntPtr.Zero, iFactoryOut_); __result__.CheckError(); } }