Beispiel #1
0
        /// <summary>
        /// Initializes static members of the <see cref="GraphicsAdapter" /> class.
        /// </summary>
        static GraphicsAdapter()
        {
#if DIRECTX11_1
            using (var factory = new Factory1())
                Initialize(factory.QueryInterface<Factory2>());
#else
            Initialize(new Factory1());
#endif
        }
Beispiel #2
0
        /// <summary>
        /// Initializes the GraphicsAdapter. On Desktop and WinRT, this is done statically.
        /// </summary>
        public static void Initialize()
        {
            if (Adapters == null)
            {
#if DIRECTX11_1
            using (var factory = new Factory1()) Initialize(factory.QueryInterface<Factory2>());
#else
                Initialize(new Factory1());
#endif
            }
        }
Beispiel #3
0
        /// <summary>
        /// Initializes the GraphicsAdapter. On Desktop and WinRT, this is done statically.
        /// </summary>
        public static void Initialize()
        {
            lock(staticLock)
            {
                if (!isInitialized)
                {
#if DIRECTX11_1
            using (var factory = new Factory1()) Initialize(factory.QueryInterface<Factory2>());
#else
                    Initialize(new Factory1());
#endif
                    isInitialized = true;
                }
            }
        }