亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? dxmutgui.cs

?? 運用directX完成的坦克游戲雛形
?? CS
?? 第 1 頁 / 共 5 頁
字號:
//--------------------------------------------------------------------------------------
// File: DXMUTGui.cs
//
// DirectX SDK Managed Direct3D GUI Sample Code
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//--------------------------------------------------------------------------------------
using System;
using System.Collections;
using Microsoft.DirectX;
using Microsoft.DirectX.Direct3D;

namespace Microsoft.Samples.DirectX.UtilityToolkit
{
    /// <summary>
    /// Predefined control types
    /// </summary>
    public enum ControlType
    {
        StaticText,
        Button,
        CheckBox,
        RadioButton,
        ComboBox,
        Slider,
        ListBox,
        EditBox,
        Scrollbar,
    }

    /// <summary>
    /// Possible states of a control
    /// </summary>
    public enum ControlState
    {
        Normal,
        Disabled,
        Hidden,
        Focus,
        MouseOver,
        Pressed,
        LastState // Should always be last
    }

    /// <summary>
    /// Blends colors
    /// </summary>
    public struct BlendColor
    {
        public ColorValue[] States; // Modulate colors for all possible control states
        public ColorValue Current; // Current color

        /// <summary>Initialize the color blending</summary>
        public void Initialize(ColorValue defaultColor, ColorValue disabledColor, ColorValue hiddenColor)
        {
            // Create the array
            States = new ColorValue[(int)ControlState.LastState];
            for(int i = 0; i < States.Length; i++)
            {
                States[i] = defaultColor;
            }

            // Store the data
            States[(int)ControlState.Disabled] = disabledColor;
            States[(int)ControlState.Hidden] = hiddenColor;
            Current = hiddenColor;
        }
        /// <summary>Initialize the color blending</summary>
        public void Initialize(ColorValue defaultColor) { Initialize( defaultColor, new ColorValue(0.5f, 0.5f, 0.5f, 0.75f),new ColorValue()); }

        /// <summary>Blend the colors together</summary>
        public void Blend(ControlState state, float elapsedTime, float rate)
        {
            if ((States == null) || (States.Length == 0) )
                return; // Nothing to do

            ColorValue destColor = States[(int)state];
            Current = ColorOperator.Lerp(Current, destColor, 1.0f - (float)Math.Pow(rate, 30 * elapsedTime) );
        }
        /// <summary>Blend the colors together</summary>
        public void Blend(ControlState state, float elapsedTime) { Blend(state, elapsedTime, 0.7f); }
    }

    /// <summary>
    /// Contains all the display information for a given control type
    /// </summary>
    public struct ElementHolder
    {
        public ControlType ControlType;
        public uint ElementIndex;
        public Element Element;
    }

    /// <summary>
    /// Contains all the display tweakables for a sub-control
    /// </summary>
    public class Element : ICloneable
    {
        #region Magic Numbers
        #endregion

        #region Instance Data
        public uint TextureIndex; // Index of the texture for this Element 
        public uint FontIndex; // Index of the font for this Element 
        public DrawTextFormat textFormat; // The Format argument to draw text

        public System.Drawing.Rectangle textureRect; // Bounding rectangle of this element on the composite texture

        public BlendColor TextureColor;
        public BlendColor FontColor;
        #endregion

        /// <summary>Set the texture</summary>
        public void SetTexture(uint tex, System.Drawing.Rectangle texRect, ColorValue defaultTextureColor)
        {
            // Store data
            TextureIndex = tex;
            textureRect = texRect;
            TextureColor.Initialize(defaultTextureColor);
        }
        /// <summary>Set the texture</summary>
        public void SetTexture(uint tex, System.Drawing.Rectangle texRect) { SetTexture(tex, texRect, Dialog.WhiteColorValue); }
        /// <summary>Set the font</summary>
        public void SetFont(uint font, ColorValue defaultFontColor, DrawTextFormat format)
        {
            // Store data
            FontIndex = font;
            textFormat = format;
            FontColor.Initialize(defaultFontColor);
        }
        /// <summary>Set the font</summary>
        public void SetFont(uint font){ SetFont(font, Dialog.WhiteColorValue, DrawTextFormat.Center | DrawTextFormat.VerticalCenter ); }
        /// <summary>
        /// Refresh this element
        /// </summary>
        public void Refresh()
        {
            if (TextureColor.States != null) 
                TextureColor.Current = TextureColor.States[(int)ControlState.Hidden];
            if (FontColor.States != null) 
                FontColor.Current = FontColor.States[(int)ControlState.Hidden];
        }

        #region ICloneable Members
        /// <summary>Clone an object</summary>
        public Element Clone() 
        { 
            Element e = new Element();
            e.TextureIndex = this.TextureIndex;
            e.FontIndex = this.FontIndex;
            e.textFormat = this.textFormat;
            e.textureRect = this.textureRect; 
            e.TextureColor = this.TextureColor;
            e.FontColor = this.FontColor;

            return e;
        }
        /// <summary>Clone an object</summary>
        object ICloneable.Clone() { throw new NotSupportedException("Use the strongly typed clone.");}

        #endregion
    }


    #region Dialog Resource Manager
    /// <summary>
    /// Structure for shared textures
    /// </summary>
    public class TextureNode 
    {
        public string Filename;
        public Texture Texture;
        public uint Width;
        public uint Height;
    }

    /// <summary>
    /// Structure for shared fonts
    /// </summary>
    public class FontNode 
    {
        public string FaceName;
        public Font Font;
        public uint Height;
        public FontWeight Weight;
    }

    /// <summary>
    /// Manages shared resources of dialogs
    /// </summary>
    public sealed class DialogResourceManager
    {
        private StateBlock dialogStateBlock;  // Stateblock shared amongst all dialogs
        private Sprite dialogSprite; // Sprite used for drawing
        public StateBlock StateBlock { get { return dialogStateBlock; } }
        public Sprite Sprite { get { return dialogSprite; } }
        private Device device; // Device

        // Lists of textures/fonts
        private ArrayList textureCache = new ArrayList();
        private ArrayList fontCache = new ArrayList();

        #region Creation
        /// <summary>Do not allow creation</summary>
        private DialogResourceManager()  {
            device = null;
            dialogSprite = null;
            dialogStateBlock = null;
        } 

        private static DialogResourceManager localObject = null;
        public static DialogResourceManager GetGlobalInstance()
        {
            if (localObject == null)
                localObject = new DialogResourceManager();

            return localObject;
        }
        #endregion

        /// <summary>Gets a font node from the cache</summary>
        public FontNode GetFontNode(int index) { return fontCache[index] as FontNode; }
        /// <summary>Gets a texture node from the cache</summary>
        public TextureNode GetTextureNode(int index) { return textureCache[index] as TextureNode; }
        /// <summary>Gets the device</summary>
        public Device Device { get { return device; } }

        /// <summary>
        /// Adds a font to the resource manager
        /// </summary>
        public int AddFont(string faceName, uint height, FontWeight weight)
        {
            // See if this font exists
            for(int i = 0; i < fontCache.Count; i++)
            {
                FontNode fn = fontCache[i] as FontNode;
                if ( (string.Compare(fn.FaceName, faceName, true) == 0) &&
                    fn.Height == height &&
                    fn.Weight == weight)
                {
                    // Found it
                    return i;
                }
            }

            // Doesn't exist, add a new one and try to create it
            FontNode newNode = new FontNode();
            newNode.FaceName = faceName;
            newNode.Height = height;
            newNode.Weight = weight;
            fontCache.Add(newNode);

            int fontIndex = fontCache.Count-1;
            // If a device is available, try to create immediately
            if (device != null)
                CreateFont(fontIndex);

            return fontIndex;
        }
        /// <summary>
        /// Adds a texture to the resource manager
        /// </summary>
        public int AddTexture(string filename)
        {
            // See if this font exists
            for(int i = 0; i < textureCache.Count; i++)
            {
                TextureNode tn = textureCache[i] as TextureNode;
                if (string.Compare(tn.Filename, filename, true) == 0)
                {
                    // Found it
                    return i;
                }
            }
            // Doesn't exist, add a new one and try to create it
            TextureNode newNode = new TextureNode();
            newNode.Filename = filename;
            textureCache.Add(newNode);

            int texIndex = textureCache.Count-1;

            // If a device is available, try to create immediately
            if (device != null)
                CreateTexture(texIndex);

            return texIndex;

        }

        /// <summary>
        /// Creates a font
        /// </summary>
        public void CreateFont(int font)
        {
            // Get the font node here
            FontNode fn = GetFontNode(font);
            if (fn.Font != null)
                fn.Font.Dispose(); // Get rid of this

            // Create the new font
            fn.Font = new Font(device, (int)fn.Height, 0, fn.Weight, 1, false, CharacterSet.Default,
                Precision.Default, FontQuality.Default, PitchAndFamily.DefaultPitch | PitchAndFamily.FamilyDoNotCare,
                fn.FaceName);
        }

        /// <summary>
        /// Creates a texture
        /// </summary>
        public void CreateTexture(int tex)
        {
            // Get the texture node here
            TextureNode tn = GetTextureNode(tex);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人a级免费电影| 欧洲色大大久久| 亚洲一区二区三区自拍| 欧美mv日韩mv国产网站app| 丁香另类激情小说| 全国精品久久少妇| 亚洲欧美日韩在线不卡| 国产亚洲成av人在线观看导航| 欧美性色欧美a在线播放| 成人午夜激情在线| 国内精品国产成人| 日韩精彩视频在线观看| 亚洲精品久久久蜜桃| 国产午夜精品福利| 26uuu国产一区二区三区| 欧美精品一卡二卡| 在线欧美日韩精品| 成人av片在线观看| 国产高清成人在线| 极品少妇xxxx精品少妇偷拍| 天天综合网天天综合色| 亚洲资源中文字幕| 亚洲欧美一区二区不卡| 亚洲欧美一区二区视频| 欧美国产在线观看| 国产亚洲欧美色| 久久久99精品免费观看| 久久综合丝袜日本网| 欧美变态凌虐bdsm| 日韩视频在线观看一区二区| 51久久夜色精品国产麻豆| 欧美色电影在线| 欧美视频一区二区在线观看| 欧美最猛性xxxxx直播| 91福利小视频| 欧美熟乱第一页| 7777女厕盗摄久久久| 日韩一区二区电影| 日韩精品一区在线| 2017欧美狠狠色| 欧美激情一区三区| 中文字幕人成不卡一区| 亚洲女性喷水在线观看一区| 一区二区三区免费网站| 亚洲第一成人在线| 日本伊人午夜精品| 黄色小说综合网站| 福利一区二区在线| 91亚洲精品久久久蜜桃网站 | 在线免费观看日本欧美| 色婷婷综合久久久中文字幕| 欧美偷拍一区二区| 91精品国产综合久久婷婷香蕉| 欧美一区二区精品在线| 欧美精品一区在线观看| 国产欧美一区二区三区沐欲| 综合色中文字幕| 五月激情六月综合| 黄色小说综合网站| 97精品视频在线观看自产线路二| 在线免费视频一区二区| 日韩欧美一区二区三区在线| 久久综合九色综合欧美亚洲| 国产精品国产三级国产aⅴ原创 | 午夜精品久久久久久久久久久| 免费人成精品欧美精品| 国产精品一区二区在线看| caoporn国产精品| 欧美三级三级三级爽爽爽| 日韩一二在线观看| 国产精品久久久久毛片软件| 亚洲成a人v欧美综合天堂下载| 麻豆国产精品一区二区三区| 99精品欧美一区二区三区小说| 欧美日韩国产成人在线免费| 亚洲精品一区二区三区福利| 亚洲婷婷在线视频| 美国av一区二区| 一本色道综合亚洲| 日韩欧美在线123| 136国产福利精品导航| 欧美a一区二区| 91视视频在线观看入口直接观看www| 欧美一级久久久| 亚洲人妖av一区二区| 免费在线一区观看| 色综合欧美在线| 久久久久成人黄色影片| 香蕉成人伊视频在线观看| 国产91露脸合集magnet| 91精品国产综合久久久久久| 国产精品国产三级国产普通话三级| 免费精品视频在线| 色老汉av一区二区三区| 久久久久国产精品人| 日韩黄色在线观看| 欧美主播一区二区三区| 国产精品不卡一区| 国内久久精品视频| 欧美偷拍一区二区| 亚洲色图色小说| 国产精一区二区三区| 欧美一区二区网站| 亚洲影院久久精品| 色综合色综合色综合色综合色综合| 欧美精品一区二区三区在线 | 欧美日韩激情一区二区三区| 中文字幕免费观看一区| 国产尤物一区二区在线| 欧美精品欧美精品系列| 一区二区三区在线观看视频| 成人综合在线观看| 久久尤物电影视频在线观看| 日本特黄久久久高潮| 在线观看av一区二区| 亚洲人成网站在线| 成人97人人超碰人人99| 国产欧美一区二区精品忘忧草| 免费的国产精品| 51午夜精品国产| 日韩不卡免费视频| 欧美色欧美亚洲另类二区| 亚洲一区在线视频观看| 一本到三区不卡视频| 综合久久一区二区三区| 99re热视频这里只精品| 国产精品久久久久久久久免费丝袜| 国产综合成人久久大片91| 精品精品欲导航| 免费成人在线观看| 精品黑人一区二区三区久久| 看电视剧不卡顿的网站| 精品国产一区二区亚洲人成毛片| 美女视频网站久久| 日韩欧美一区电影| 久久99蜜桃精品| 亚洲精品一区二区三区四区高清| 国产永久精品大片wwwapp | 久久日韩粉嫩一区二区三区| 久久国产剧场电影| 亚洲精品一线二线三线| 国产美女娇喘av呻吟久久| 国产精品丝袜久久久久久app| 丁香六月久久综合狠狠色| 国产精品二三区| 色噜噜狠狠一区二区三区果冻| 悠悠色在线精品| 欧美日韩国产区一| 久久国产夜色精品鲁鲁99| 久久噜噜亚洲综合| 97久久久精品综合88久久| 亚洲精品ww久久久久久p站 | 精品国产乱码久久久久久牛牛| 狠狠狠色丁香婷婷综合久久五月| 国产亚洲人成网站| 91网页版在线| 日韩电影免费在线看| 精品国产露脸精彩对白| 成人久久18免费网站麻豆| 亚洲精选一二三| 777久久久精品| 国产成人一级电影| 亚洲一区在线视频| 日韩免费在线观看| 成人av资源下载| 午夜精品久久久久久久99樱桃| 欧美成人官网二区| 不卡欧美aaaaa| 日韩和欧美的一区| 欧美经典一区二区| 欧美亚洲精品一区| 国产美女精品一区二区三区| 亚洲综合丁香婷婷六月香| 精品免费视频.| 日本精品视频一区二区三区| 美女视频一区二区三区| 亚洲日本一区二区| 日韩一区二区三区电影| 97se亚洲国产综合自在线| 日韩**一区毛片| 中文字幕在线观看不卡| 欧美一级高清大全免费观看| 成人av中文字幕| 久久国产精品无码网站| 亚洲一区二区高清| 国产清纯白嫩初高生在线观看91 | 国产真实乱子伦精品视频| 亚洲三级视频在线观看| 欧美xxxxxxxxx| 色狠狠色噜噜噜综合网| 国产精品一区二区男女羞羞无遮挡| 亚洲国产日韩在线一区模特 | 国产精品视频九色porn| 制服丝袜成人动漫| 91麻豆免费看片| 国产精品夜夜爽| 日韩一区欧美二区| 亚洲欧美经典视频| 国产午夜亚洲精品羞羞网站| 91麻豆精品国产91久久久久久 |