コード例 #1
0
        public override void ResourceLoad()
        {
            base.ResourceLoad();

            stateBlock = new StateBlock(Device, StateBlockType.All);
            lineBuffer = new DynamicPrimitiveBuffer9 <ColoredVertex>(Device);
        }
コード例 #2
0
        public override void ResourceUnload()
        {
            base.ResourceUnload();

            if (stateBlock != null)
            {
                stateBlock.Dispose();
                stateBlock = null;
            }

            if (lineBuffer != null)
            {
                lineBuffer.Dispose();
                lineBuffer = null;
            }
        }
コード例 #3
0
        protected override void Dispose(bool disposeManaged)
        {
            base.Dispose(disposeManaged);

            if (stateBlock != null)
            {
                stateBlock.Dispose();
                lineBuffer = null;
            }

            if (lineBuffer != null)
            {
                lineBuffer.Dispose();
                lineBuffer = null;
            }
        }
コード例 #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UserInterfaceRenderer9"/> class.
        /// </summary>
        /// <param name="device">The device.</param>
        /// <param name="width">The width of the renderable area.</param>
        /// <param name="height">The height of the renderable area.</param>
        public UserInterfaceRenderer9(Device device, int width, int height)
        {
            if (device == null)
            {
                throw new ArgumentNullException("device");
            }
            if (width < 0)
            {
                throw new ArgumentException("Value must be positive.", "width");
            }
            if (height < 0)
            {
                throw new ArgumentException("Value must be positive.", "height");
            }

            this.device = device;
            halfWidth   = width / 2;
            halfHeight  = height / 2;

            font       = new Font(device, 18, 0, FontWeight.Bold, 0, false, CharacterSet.Default, Precision.Default, FontQuality.Antialiased, PitchAndFamily.Default, "Arial");
            lineBuffer = new DynamicPrimitiveBuffer9 <ColoredVertex>(device);

            stateBlock = new StateBlock(device, StateBlockType.All);
        }