Exemple #1
0
        public static int D2D1CreateFactory <Factory>(D2D1_FACTORY_TYPE factoryType, [NativeTypeName("void **")] void **factory)
            where Factory : unmanaged
        {
            var iid = typeof(Factory).GUID;

            return(D2D1CreateFactory(factoryType, &iid, null, factory));
        }
Exemple #2
0
        public static int D2D1CreateFactory <Factory>(D2D1_FACTORY_TYPE factoryType, [NativeTypeName("const D2D1_FACTORY_OPTIONS *")] D2D1_FACTORY_OPTIONS *pFactoryOptions, [NativeTypeName("void **")] void **factory)
            where Factory : unmanaged
        {
            var iid = typeof(Factory).GUID;

            return(D2D1CreateFactory(factoryType, &iid, pFactoryOptions, factory));
        }
Exemple #3
0
 public static extern HRESULT D2D1CreateFactory
 (
     D2D1_FACTORY_TYPE factoryType,
     [In, MarshalAs(UnmanagedType.LPStruct)] Guid riid,
     [In] D2D1_FACTORY_OPTIONS pFactoryOptions,
     out ID2D1Factory factory
 );
Exemple #4
0
        public static IComObject <T> D2D1CreateFactory <T>(D2D1_FACTORY_TYPE type = D2D1_FACTORY_TYPE.D2D1_FACTORY_TYPE_MULTI_THREADED, D2D1_FACTORY_OPTIONS?options = null)
        {
            var op = new D2D1_FACTORY_OPTIONS();

#if DEBUG
            //op.debugLevel = D2D1_DEBUG_LEVEL.D2D1_DEBUG_LEVEL_INFORMATION;
#endif
            if (options.HasValue)
            {
                op.debugLevel = options.Value.debugLevel;
            }
            D2D1CreateFactory(type, typeof(T).GUID, ref op, out object factory).ThrowOnError();

#if DEBUG
            // this will:
            // 1) display a message in output
            // 2) raise a breakpoint

            if (IntPtr.Size == 8)
            {
                var ptr = GetModuleHandle("d2d1.dll");

                // d2d1 (00007ffd`d8b00000)
                // d2d1!g_dimageBreakLevel (00007ffd`d90756ac)‬ => 5756AC
                // d2d1!g_dimageTraceLevel (00007ffd`d90756b0) => 5756B0

                Marshal.WriteInt32(ptr + 0x5756AC, -1);
                Marshal.WriteInt32(ptr + 0x5756B0, -1);
            }
#endif
            return(new ComObject <T>((T)factory));
        }
Exemple #5
0
        public static ComObject <T> D2D1CreateFactory <T>(D2D1_FACTORY_TYPE type = D2D1_FACTORY_TYPE.D2D1_FACTORY_TYPE_MULTI_THREADED, D2D1_FACTORY_OPTIONS?options = null)
        {
            var op = new D2D1_FACTORY_OPTIONS();

            if (options.HasValue)
            {
                op.debugLevel = options.Value.debugLevel;
            }
            D2D1CreateFactory(type, typeof(T).GUID, ref op, out object factory).ThrowOnError();
            return(new ComObject <T>((T)factory));
        }
Exemple #6
0
 public static int D2D1CreateFactory(D2D1_FACTORY_TYPE factoryType, [NativeTypeName("const IID &")] Guid *riid, void **factory)
 {
     return(D2D1CreateFactory(factoryType, riid, null, factory));
 }
Exemple #7
0
 public static extern int D2D1CreateFactory(D2D1_FACTORY_TYPE factoryType, [NativeTypeName("const IID &")] Guid *riid, [NativeTypeName("const D2D1_FACTORY_OPTIONS *")] D2D1_FACTORY_OPTIONS *pFactoryOptions, void **ppIFactory);
Exemple #8
0
 public static IComObject <ID2D1Factory> D2D1CreateFactory(D2D1_FACTORY_TYPE type = D2D1_FACTORY_TYPE.D2D1_FACTORY_TYPE_MULTI_THREADED, D2D1_FACTORY_OPTIONS?options = null) => D2D1CreateFactory <ID2D1Factory>(type, options);
Exemple #9
0
 public static extern HRESULT D2D1CreateFactory(D2D1_FACTORY_TYPE factoryType, [MarshalAs(UnmanagedType.LPStruct)] Guid riid, ref D2D1_FACTORY_OPTIONS pFactoryOptions, [MarshalAs(UnmanagedType.IUnknown)] out object ppIFactory);
 private static extern int D2D1CreateFactory(D2D1_FACTORY_TYPE factoryType, [MarshalAs(UnmanagedType.LPStruct)] Guid riid, IntPtr pFactoryOptions, out ID2D1Factory ppIFactory);
Exemple #11
0
 public static extern int D2D1CreateFactory(D2D1_FACTORY_TYPE factoryType, IntPtr riid, IntPtr pFactoryOptions, [MarshalAs(UnmanagedType.Interface)] out object ppIFactory);
 public static HRESULT D2D1CreateFactory <TFactory>(D2D1_FACTORY_TYPE factoryType, [NativeTypeName("const D2D1_FACTORY_OPTIONS *")] D2D1_FACTORY_OPTIONS *pFactoryOptions, void **factory)
     where TFactory : unmanaged, IUnknown.Interface
 {
     return(D2D1CreateFactory(factoryType, __uuidof <TFactory>(), pFactoryOptions, factory));
 }
 public static HRESULT D2D1CreateFactory <TFactory>(D2D1_FACTORY_TYPE factoryType, void **factory)
     where TFactory : unmanaged, IUnknown.Interface
 {
     return(D2D1CreateFactory(factoryType, __uuidof <TFactory>(), null, factory));
 }
 private static extern object D2D1CreateFactory(D2D1_FACTORY_TYPE factoryType,
                                                [MarshalAs(UnmanagedType.LPStruct)] Guid riid,
                                                D2D1_FACTORY_OPTIONS pFactoryOptions);
Exemple #15
0
 public static extern int D2D1CreateFactory(
     D2D1_FACTORY_TYPE factoryType,
     ref Guid riid,
     ref D2D1_FACTORY_OPTIONS pFactoryOptions,
     out IntPtr ppIFactory
     );