Ejemplo n.º 1
0
        /// <summary>
        /// Gets a reference to the singleton instance.
        /// </summary>
        public static SlimDXGraphicsDeviceService9 AddRef(int width, int height)
        {
            // Increment the "how many controls sharing the device" reference count.
            if (Interlocked.Increment(ref referenceCount) == 1)
            {
                // If this is the first control to start using the
                // device, we must create the singleton instance.
                singletonInstance = new SlimDXGraphicsDeviceService9(width, height);
            }

            return(singletonInstance);
        }
        /// <summary>
        /// Gets a reference to the singleton instance.
        /// </summary>
        public static SlimDXGraphicsDeviceService9 AddRef(int width, int height)
        {
            // Increment the "how many controls sharing the device" reference count.
            if (Interlocked.Increment(ref referenceCount) == 1)
            {
                // If this is the first control to start using the
                // device, we must create the singleton instance.
                singletonInstance = new SlimDXGraphicsDeviceService9(width, height);
            }

            return singletonInstance;
        }