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

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

?? dxmut.cs

?? VC中使用C#作為腳本引擎編程
?? CS
?? 第 1 頁 / 共 5 頁
字號:
        /// MatchOptions struct specifies how the function makes decisions.  For example, if 
        /// the caller wants a hardware device with a back buffer format of A2B10G10R10 but the 
        /// hardware device on the system does not support A2B10G10R10 however a reference device is 
        /// installed that does, then the function has a choice to either use the reference device
        /// or to change to a back buffer format to compatible with the hardware device.  The match options lets the 
        /// caller control how these choices are made.
        /// 
        /// Each match option must be one of the following types: 
        /// MatchType.IgnoreInput: Uses the closest valid value to a default 
        /// MatchType.PreserveInput: Uses the input without change, but may cause no valid device to be found
        /// MatchType.ClosestToInput: Uses the closest valid value to the input 
        /// </summary>
        private DeviceSettings FindValidDeviceSettings(DeviceSettings settings, MatchOptions match)
        {
            // Build an optimal device settings structure based upon the match 
            // options.  If the match option is set to ignore, then a optimal default value is used.
            // The default value may not exist on the system, but later this will be taken 
            // into account.
            DeviceSettings optimalSettings = BuildOptimalDeviceSettings(settings, match);
            float bestRanking = -1.0f;
            EnumDeviceSettingsCombo bestDeviceSettingsCombo = new EnumDeviceSettingsCombo();

            // Find the best combination of:
            //      Adapter Ordinal
            //      Device Type
            //      Adapter Format
            //      Back Buffer Format
            //      Windowed
            // given what's available on the system and the match options combined with the device settings input.
            // This combination of settings is encapsulated by the EnumDeviceSettingsCombo class.
            DisplayMode adapterDesktopDisplayMode;
            for (int iAdapter = 0; iAdapter < Enumeration.AdapterInformationList.Count; iAdapter++)
            {
                EnumAdapterInformation adapterInfo = Enumeration.AdapterInformationList[iAdapter] as EnumAdapterInformation;
                
                // Get the desktop display mode of the adapter
                adapterDesktopDisplayMode = Manager.Adapters[(int)adapterInfo.AdapterOrdinal].CurrentDisplayMode;

                // Enum all the device types supported by this adapter to find the best device settings
                for (int iDeviceInfo = 0; iDeviceInfo < adapterInfo.deviceInfoList.Count; iDeviceInfo++)
                {
                    EnumDeviceInformation deviceInfo = adapterInfo.deviceInfoList[iDeviceInfo] as EnumDeviceInformation;
                    for (int iDeviceCombo = 0; iDeviceCombo<deviceInfo.deviceSettingsList.Count; iDeviceCombo++)
                    {
                        EnumDeviceSettingsCombo deviceSettings = deviceInfo.deviceSettingsList[iDeviceCombo] as EnumDeviceSettingsCombo;
                        // If windowed mode the adapter format has to be the same as the desktop 
                        // display mode format so skip any that don't match
                        if (deviceSettings.IsWindowed && (deviceSettings.AdapterFormat != adapterDesktopDisplayMode.Format))
                            continue;

                        // Skip any combo that doesn't meet the preserve match options
                        if(!DoesDeviceComboMatchPreserveOptions(deviceSettings, settings, match))
                            continue;           

                        // Get a ranking number that describes how closely this device combo matches the optimal combo
                        float curRanking = RankDeviceCombo(deviceSettings, optimalSettings, adapterDesktopDisplayMode);

                        // If this combo better matches the input device settings then save it
                        if (curRanking > bestRanking )
                        {
                            bestDeviceSettingsCombo = deviceSettings;
                            bestRanking = curRanking;
                        }                
                    }
                }
            }

            // If no best device combination was found then fail
            if (bestRanking == -1.0f)
            {
                throw new NoCompatibleDevicesException();
            }

            // Using the best device settings combo found, build valid device settings taking heed of 
            // the match options and the input device settings
            return BuildValidDeviceSettings(bestDeviceSettingsCombo, settings, match);
        }
        /// <summary>
        /// Calls FindValidDeviceSettings with default match options (all ignore)
        /// </summary>
        private DeviceSettings FindValidDeviceSettings(DeviceSettings settings)
        {
            return FindValidDeviceSettings(settings, new MatchOptions());
        }

        /// <summary>
        /// public helper function to build a device settings structure based upon the match 
        /// options.  If the match option is set to ignore, then a optimal default value is used.
        /// The default value may not exist on the system, but later this will be taken 
        /// into account.
        /// </summary>
        private DeviceSettings BuildOptimalDeviceSettings(DeviceSettings settings, MatchOptions match)
        {
            DeviceSettings optimal = new DeviceSettings(); // This will be what we return
            optimal.presentParams = new PresentParameters();

            //---------------------
            // Adapter ordinal
            //---------------------    
            if (match.AdapterOrdinal == MatchType.IgnoreInput)
                optimal.AdapterOrdinal = 0; 
            else
                optimal.AdapterOrdinal = settings.AdapterOrdinal;      

            //---------------------
            // Device type
            //---------------------
            if (match.DeviceType == MatchType.IgnoreInput)
                optimal.DeviceType = DeviceType.Hardware; 
            else
                optimal.DeviceType = settings.DeviceType;

            //---------------------
            // Windowed
            //---------------------
            if (match.Windowed == MatchType.IgnoreInput)
                optimal.presentParams.Windowed = true; 
            else
                optimal.presentParams.Windowed = settings.presentParams.Windowed;

            //---------------------
            // Adapter format
            //---------------------
            if (match.AdapterFormat == MatchType.IgnoreInput)
            {
                // If windowed, default to the desktop display mode
                // If fullscreen, default to the desktop display mode for quick mode change or 
                // default to Format.X8R8G8B8 if the desktop display mode is < 32bit
                DisplayMode adapterDesktopMode = Manager.Adapters[(int)optimal.AdapterOrdinal].CurrentDisplayMode;

                if (optimal.presentParams.Windowed || 
                    ManagedUtility.GetColorChannelBits(adapterDesktopMode.Format) >= 8 )
                    optimal.AdapterFormat = adapterDesktopMode.Format;
                else
                    optimal.AdapterFormat = Format.X8R8G8B8;
            }
            else
            {
                optimal.AdapterFormat = settings.AdapterFormat;
            }

            //---------------------
            // Vertex processing
            //---------------------
            if (match.VertexProcessing == MatchType.IgnoreInput)
                optimal.BehaviorFlags = CreateFlags.HardwareVertexProcessing; 
            else
                optimal.BehaviorFlags = settings.BehaviorFlags;

            //---------------------
            // Resolution
            //---------------------
            if (match.Resolution == MatchType.IgnoreInput)
            {
                // If windowed, default to 640x480
                // If fullscreen, default to the desktop res for quick mode change
                if (optimal.presentParams.Windowed )
                {
                    optimal.presentParams.BackBufferWidth = DefaultSizeWidth;
                    optimal.presentParams.BackBufferHeight = DefaultSizeHeight;
                }
                else
                {
                    DisplayMode adapterDesktopMode = Manager.Adapters[(int)optimal.AdapterOrdinal].CurrentDisplayMode;

                    optimal.presentParams.BackBufferWidth = adapterDesktopMode.Width;
                    optimal.presentParams.BackBufferHeight = adapterDesktopMode.Height;
                }
            }
            else
            {
                optimal.presentParams.BackBufferWidth = settings.presentParams.BackBufferWidth;
                optimal.presentParams.BackBufferHeight = settings.presentParams.BackBufferHeight;
            }

            //---------------------
            // Back buffer format
            //---------------------
            if (match.BackBufferFormat == MatchType.IgnoreInput)
                optimal.presentParams.BackBufferFormat = optimal.AdapterFormat; // Default to match the adapter format
            else
                optimal.presentParams.BackBufferFormat = settings.presentParams.BackBufferFormat;

            //---------------------
            // Back buffer count
            //---------------------
            if (match.BackBufferCount == MatchType.IgnoreInput)
                optimal.presentParams.BackBufferCount = 2; // Default to triple buffering for perf gain
            else
                optimal.presentParams.BackBufferCount = settings.presentParams.BackBufferCount;
   
            //---------------------
            // Multisample
            //---------------------
            if (match.MultiSample == MatchType.IgnoreInput)
                optimal.presentParams.MultiSampleQuality = 0; // Default to no multisampling 
            else
                optimal.presentParams.MultiSampleQuality = settings.presentParams.MultiSampleQuality;

            //---------------------
            // Swap effect
            //---------------------
            if (match.SwapEffect == MatchType.IgnoreInput)
                optimal.presentParams.SwapEffect = SwapEffect.Discard; 
            else
                optimal.presentParams.SwapEffect = settings.presentParams.SwapEffect;

            //---------------------
            // Depth stencil 
            //---------------------
            if (match.DepthFormat == MatchType.IgnoreInput &&
                match.StencilFormat == MatchType.IgnoreInput)
            {
                uint backBufferBits = ManagedUtility.GetColorChannelBits(optimal.presentParams.BackBufferFormat);
                if (backBufferBits >= 8)
                    optimal.presentParams.AutoDepthStencilFormat = DepthFormat.D32; 
                else
                    optimal.presentParams.AutoDepthStencilFormat = DepthFormat.D16; 
            }
            else
            {
                optimal.presentParams.AutoDepthStencilFormat = settings.presentParams.AutoDepthStencilFormat;
            }

            //---------------------
            // Present flags
            //---------------------
            if (match.PresentFlags == MatchType.IgnoreInput)
                optimal.presentParams.PresentFlag = PresentFlag.DiscardDepthStencil;
            else
                optimal.presentParams.PresentFlag = settings.presentParams.PresentFlag;

            //---------------------
            // Refresh rate
            //---------------------
            if (match.RefreshRate == MatchType.IgnoreInput)
                optimal.presentParams.FullScreenRefreshRateInHz = 0;
            else
                optimal.presentParams.FullScreenRefreshRateInHz = settings.presentParams.FullScreenRefreshRateInHz;

            //---------------------
            // Present interval
            //---------------------
            if (match.PresentInterval == MatchType.IgnoreInput)
            {
                // For windowed, default to PresentInterval.Immediate
                // which will wait not for the vertical retrace period to prevent tearing, 
                // but may introduce tearing.
                // For full screen, default to PresentInterval.Default 
                // which will wait for the vertical retrace period to prevent tearing.
                if (optimal.presentParams.Windowed )
                    optimal.presentParams.PresentationInterval = PresentInterval.Immediate;
                else
                    optimal.presentParams.PresentationInterval = PresentInterval.Default;
            }
            else
            {
                optimal.presentParams.PresentationInterval = settings.presentParams.PresentationInterval;
            }

            return optimal;
        }


        /// <summary>
        /// Builds valid device settings using the match options, the input device settings, and the 
        /// best device settings combo found.
        /// </summary>
        private DeviceSettings BuildValidDeviceSettings(EnumDeviceSettingsCombo deviceCombo, DeviceSettings settings, MatchOptions match)
        {
            DeviceSettings validSettings = new DeviceSettings();
            DisplayMode adapterDesktopDisplayMode = Manager.Adapters[(int)deviceCombo.AdapterOrdinal].CurrentDisplayMode;

            // For each setting pick the best, taking into account the match options and 
            // what's supported by the device

            //---------------------
            // Adapter Ordinal

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
激情久久五月天| 亚洲一二三区视频在线观看| 91精品国产免费| 欧美电视剧在线观看完整版| 久久久久久久久久看片| 亚洲欧洲精品成人久久奇米网| 国产精品毛片无遮挡高清| 亚洲精品免费在线观看| 蜜臀av性久久久久蜜臀av麻豆| 国产精品一品视频| 91国产成人在线| 精品日韩99亚洲| 一区二区三区四区中文字幕| 久久se这里有精品| 色吊一区二区三区| 久久久精品国产免大香伊| 亚洲激情图片一区| 国产精品一二三在| 日韩欧美中文字幕制服| 18成人在线观看| 国产精品羞羞答答xxdd| 欧美一区三区二区| 亚洲二区在线视频| 91麻豆国产福利精品| 久久久99精品久久| 久久99久久99小草精品免视看| 在线视频一区二区免费| |精品福利一区二区三区| 国产一区欧美二区| 欧美www视频| 加勒比av一区二区| 欧美一区二区在线观看| 亚洲成av人片观看| 91 com成人网| 麻豆精品一区二区三区| 日韩欧美亚洲一区二区| 国内欧美视频一区二区| 久久人人超碰精品| 成人精品小蝌蚪| 亚洲图片另类小说| 精品1区2区3区| 日韩成人一级片| 久久综合色一综合色88| 成人天堂资源www在线| 亚洲欧美自拍偷拍| 欧美一级生活片| 国产毛片精品国产一区二区三区| 精品国产乱子伦一区| av成人动漫在线观看| 亚洲高清免费视频| 欧美极品xxx| 欧美久久高跟鞋激| 国产传媒欧美日韩成人| 亚洲一级电影视频| 久久久久99精品国产片| 在线中文字幕不卡| 韩国成人在线视频| 亚洲午夜在线视频| 国产精品久久久久永久免费观看| 欧美日韩三级在线| 福利电影一区二区三区| 麻豆一区二区三| 亚洲综合色噜噜狠狠| 欧美激情综合在线| 精品三级av在线| 欧美电影一区二区三区| 黄色成人免费在线| 亚洲色图在线播放| 欧美α欧美αv大片| 91在线视频播放地址| 日本视频免费一区| 亚洲高清不卡在线| 国产午夜精品理论片a级大结局| 91片在线免费观看| 麻豆视频观看网址久久| 成人免费在线观看入口| 日韩免费电影一区| 色偷偷久久一区二区三区| 高清国产一区二区| 奇米在线7777在线精品| 伊人一区二区三区| 中文字幕在线观看一区| 精品国产免费久久| 久久精品无码一区二区三区| 在线不卡a资源高清| 精品视频免费看| 在线精品国精品国产尤物884a| 国产精品综合av一区二区国产馆| 日本中文字幕一区二区视频| 亚洲永久精品大片| 一个色综合网站| 日一区二区三区| 亚洲成人av中文| 蜜臀av国产精品久久久久| 麻豆国产精品视频| 国模娜娜一区二区三区| 国产精品综合一区二区| 播五月开心婷婷综合| 99re在线视频这里只有精品| 在线观看av不卡| 这里只有精品电影| 久久综合国产精品| 国产精品国产成人国产三级| 亚洲伦理在线免费看| 午夜成人免费视频| 国产乱子轮精品视频| 91一区一区三区| 久久一留热品黄| 有坂深雪av一区二区精品| 麻豆精品久久久| 在线亚洲高清视频| 国产欧美日韩三区| 亚洲成年人网站在线观看| 成人免费观看视频| 日韩欧美国产系列| 中文字幕中文乱码欧美一区二区 | 欧美性欧美巨大黑白大战| 国产亚洲一区二区三区四区| 亚洲精品综合在线| 国产精品一区二区三区四区| 欧美日韩精品欧美日韩精品| 国产人久久人人人人爽| 午夜电影网一区| 在线观看精品一区| 亚洲品质自拍视频网站| 91老师国产黑色丝袜在线| 国产日韩综合av| www.色综合.com| 亚洲女厕所小便bbb| 在线观看三级视频欧美| 亚洲激情中文1区| 欧美精品亚洲一区二区在线播放| 亚洲午夜精品网| 欧美一区在线视频| 国产精品一区二区不卡| 亚洲日本免费电影| 欧美日韩午夜在线| 老司机一区二区| 欧美激情综合在线| 欧美精品aⅴ在线视频| 麻豆国产精品官网| 亚洲欧美另类在线| 91精品国产欧美一区二区18| 欧美bbbbb| 亚洲少妇30p| 久久精品亚洲乱码伦伦中文| 一本一道久久a久久精品综合蜜臀| 五月综合激情日本mⅴ| 2欧美一区二区三区在线观看视频| av午夜一区麻豆| 蜜桃视频一区二区三区| 国产精品电影一区二区三区| 91精品国产综合久久久久久| a美女胸又www黄视频久久| 国产中文字幕一区| 午夜av一区二区| 亚洲九九爱视频| 中文字幕欧美日本乱码一线二线| 欧美三级三级三级| 欧美三电影在线| 91亚洲精品乱码久久久久久蜜桃| 久久99精品一区二区三区| 亚洲成人免费视频| 午夜视频一区二区| 一区二区不卡在线视频 午夜欧美不卡在 | 欧美久久久久中文字幕| 在线一区二区视频| 色偷偷88欧美精品久久久| 99在线精品免费| 91亚洲国产成人精品一区二区三| 国产69精品久久99不卡| 狠狠色丁香婷婷综合| 国产乱码精品一区二区三区av| 美女精品自拍一二三四| 青青青爽久久午夜综合久久午夜| 亚洲综合成人网| 天天色综合成人网| 美女国产一区二区三区| 久久电影网站中文字幕| 蓝色福利精品导航| 国产成人综合在线| 粉嫩高潮美女一区二区三区| 91原创在线视频| 欧美日韩国产电影| 精品久久一二三区| 国产亲近乱来精品视频| 亚洲精品欧美激情| 毛片不卡一区二区| 99久久免费视频.com| 9191精品国产综合久久久久久| 日韩一区二区在线播放| 国产精品久久久久久久久晋中| 亚洲综合一区在线| 国产自产v一区二区三区c| 欧美亚日韩国产aⅴ精品中极品| 欧美大度的电影原声| 一区二区免费看| 国产一区二区美女| 欧美一区二区三区在线| 亚洲欧洲日产国码二区|