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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? dxmutenum.cs

?? VC中使用C#作為腳本引擎編程
?? CS
?? 第 1 頁 / 共 3 頁
字號:
//--------------------------------------------------------------------------------------
// File: DXMUTEnum.cs
//
// Enumerates D3D adapters, devices, modes, etc.
//
// 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>
    /// Enumerates available Direct3D adapters, devices, modes, etc.  Singleton.
    /// </summary>
    public sealed class Enumeration
    {
        #region Creation (Not allowed)
        private Enumeration() {} // Do Not allow Creation
        /// <summary>
        /// Static constructor to create default lists
        /// </summary>
        static Enumeration()
        {
            // Create the default lists
            ResetPossibleDepthStencilFormats();
            ResetPossibleMultisampleTypeList();
            ResetPossiblePresentIntervalList();
        } 
        #endregion

        // Static Data
        private static bool isPostPixelShaderBlendingRequired = true;
        private static IDeviceCreation deviceCreationInterface = null;

        // Vertex processing
        private static bool isSoftwareVertexProcessing = true;
        private static bool isHardwareVertexProcessing = true;
        private static bool isPureHardwareVertexProcessing = true;
        private static bool isMixedVertexProcessing = false;

        // Limits
        private static uint minimumWidth = 0;
        private static uint maximumWidth = uint.MaxValue;
        private static uint minimumHeight = 0;
        private static uint maximumHeight = uint.MaxValue;
        private static uint minimumRefresh = 0;
        private static uint maximumRefresh = uint.MaxValue;
        private static uint multisampleQualityMax = 0xffff;

        // Lists
        private static ArrayList depthStencilPossibleList = new ArrayList();
        private static ArrayList multiSampleTypeList = new ArrayList();
        private static ArrayList presentIntervalList = new ArrayList();
        private static ArrayList adapterInformationList = new ArrayList();

        // Default arrays
        private static readonly Format[] allowedFormats = new Format[] {
                        Format.X8R8G8B8, 
                        Format.X1R5G5B5,
                        Format.R5G6B5,
                        Format.A2R10G10B10 };
        private static readonly Format[] backbufferFormatsArray = new Format[] {
                        Format.A8R8G8B8,
                        Format.X8R8G8B8, 
                        Format.A1R5G5B5,
                        Format.X1R5G5B5,
                        Format.R5G6B5,
                        Format.A2R10G10B10 };
        private static readonly DeviceType[] deviceTypeArray = new DeviceType[] {
                        DeviceType.Hardware,
                        DeviceType.Software,
                        DeviceType.Reference };


        // Implementation

        /// <summary>
        /// Enumerates available D3D adapters, devices, modes, etc
        /// </summary>
        public static void Enumerate(IDeviceCreation acceptableCallback)
        {
            DisplayModeSorter sorter = new DisplayModeSorter();
            try
            {
                // Store the callback
                deviceCreationInterface = acceptableCallback;

                // Clear the adapter information stored currently
                adapterInformationList.Clear();
                ArrayList adapterFormatList = new ArrayList();

                // Look through every adapter on the system
                foreach(AdapterInformation ai in Manager.Adapters)
                {
                    EnumAdapterInformation adapterInfo = new EnumAdapterInformation();
                    // Store some information
                    adapterInfo.AdapterOrdinal = (uint)ai.Adapter; // Ordinal
                    adapterInfo.AdapterInformation = ai.Information; // Information

                    // Get list of all display modes on this adapter.  
                    // Also build a temporary list of all display adapter formats.
                    adapterFormatList.Clear();

                    // Now check to see which formats are supported
                    for(int i = 0; i < allowedFormats.Length; i++)
                    {
                        // Check each of the supported display modes for this format
                        foreach(DisplayMode dm in ai.SupportedDisplayModes[allowedFormats[i]])
                        {
                            if ( (dm.Width < minimumWidth) ||
                                (dm.Height < minimumHeight) ||
                                (dm.Width > maximumWidth) ||
                                (dm.Height > maximumHeight) ||
                                (dm.RefreshRate < minimumRefresh) ||
                                (dm.RefreshRate > maximumRefresh) )
                            {
                                continue; // This format isn't valid
                            }

                            // Add this to the list
                            adapterInfo.displayModeList.Add(dm);

                            // Add this to the format list if it doesn't already exist
                            if (!adapterFormatList.Contains(dm.Format))
                            {
                                adapterFormatList.Add(dm.Format);
                            }
                        }
                    }

                    // Get the adapter display mode
                    DisplayMode currentAdapterMode = ai.CurrentDisplayMode;
                    // Check to see if this format is in the list
                    if (!adapterFormatList.Contains(currentAdapterMode.Format))
                    {
                        adapterFormatList.Add(currentAdapterMode.Format);
                    }

                    // Sort the display mode list
                    adapterInfo.displayModeList.Sort(sorter);

                    // Get information for each device with this adapter
                    EnumerateDevices(adapterInfo, adapterFormatList);

                    // If there was at least one device on the adapter, and it's compatible
                    // add it to the list
                    if (adapterInfo.deviceInfoList.Count > 0)
                    {
                        adapterInformationList.Add(adapterInfo);
                    }
                }

                // See if all of the descriptions are unique
                bool isUnique = true;
                for(int i = 0; i < adapterInformationList.Count; i++)
                {
                    for (int j = i+1; j < adapterInformationList.Count; j++)
                    {
                        EnumAdapterInformation eai1 = adapterInformationList[i] as EnumAdapterInformation;
                        EnumAdapterInformation eai2 = adapterInformationList[j] as EnumAdapterInformation;

                        if (string.Compare(eai1.AdapterInformation.Description,
                            eai2.AdapterInformation.Description, true) == 0)
                        {
                            isUnique = false;
                            break;
                        }
                    }
                    if (!isUnique)
                        break;
                }

                // Now fill the unique description
                for(int i = 0; i < adapterInformationList.Count; i++)
                {
                    EnumAdapterInformation eai1 = adapterInformationList[i] as EnumAdapterInformation;

                    eai1.UniqueDescription = eai1.AdapterInformation.Description;
                    // If the descriptions aren't unique, append the adapter ordinal
                    if (!isUnique)
                        eai1.UniqueDescription += string.Format(" (#{0})", eai1.AdapterOrdinal);
                }
            }
            catch (TypeLoadException)
            {
                // Couldn't load the manager class, no Direct is available.
                throw new NoDirect3DException();
            }
        }

        /// <summary>
        /// Enumerates D3D devices for a particular adapter.
        /// </summary>
        private static void EnumerateDevices(EnumAdapterInformation adapterInfo, ArrayList adapterFormatList)
        {
            // Ignore any exceptions while looking for these device types
            DirectXException.IgnoreExceptions();
            // Enumerate each Direct3D device type
            for(uint i = 0; i < deviceTypeArray.Length; i++)
            {
                // Create a new device information object
                EnumDeviceInformation deviceInfo = new EnumDeviceInformation();

                // Store the type
                deviceInfo.DeviceType = deviceTypeArray[i];

                // Try to get the capabilities
                deviceInfo.Caps = Manager.GetDeviceCaps((int)adapterInfo.AdapterOrdinal, deviceInfo.DeviceType);

                // Get information about each device combination on this device
                EnumerateDeviceCombos( adapterInfo, deviceInfo, adapterFormatList);

                // Do we have any device combinations?
                if (deviceInfo.deviceSettingsList.Count > 0)
                {
                    // Yes, add it
                    adapterInfo.deviceInfoList.Add(deviceInfo);
                }
            }
            // Turn exception handling back on
            DirectXException.EnableExceptions();
        }

        /// <summary>
        /// Enumerates device combinations for a particular device.
        /// </summary>
        private static void EnumerateDeviceCombos(EnumAdapterInformation adapterInfo, EnumDeviceInformation deviceInfo, 
            ArrayList adapterFormatList)
        {
            // Find out which adapter formats are supported by this device
            foreach(Format adapterFormat in adapterFormatList)
            {
                for(int i = 0; i < backbufferFormatsArray.Length; i++)
                {
                    // Go through each windowed mode
                    for (int windowedIndex = 0; windowedIndex < 2; windowedIndex++)
                    {
                        bool isWindowedIndex = (windowedIndex == 1);
                        if ((!isWindowedIndex) && (adapterInfo.displayModeList.Count == 0))
                            continue; // Nothing here

                        if (!Manager.CheckDeviceType((int)adapterInfo.AdapterOrdinal, deviceInfo.DeviceType,
                            adapterFormat, backbufferFormatsArray[i], isWindowedIndex))
                            continue; // Unsupported

                        // Do we require post pixel shader blending?
                        if (isPostPixelShaderBlendingRequired)
                        {
                            // If the backbuffer format doesn't support Usage.QueryPostPixelShaderBlending
                            // then alpha test, pixel fog, render-target blending, color write enable, and dithering
                            // are not supported.
                            if (!Manager.CheckDeviceFormat((int)adapterInfo.AdapterOrdinal, deviceInfo.DeviceType,
                                    adapterFormat, Usage.QueryPostPixelShaderBlending, 
                                    ResourceType.Textures, backbufferFormatsArray[i]))
                                continue; // Unsupported
                        }

                        // If an application callback function has been provided, make sure this device
                        // is acceptable to the app.
                        if (deviceCreationInterface != null)
                        {
                            if (!deviceCreationInterface.IsDeviceAcceptable(deviceInfo.Caps, 
                                adapterFormat, backbufferFormatsArray[i],isWindowedIndex))
                                continue; // Application doesn't like this device
                        }

                        // At this point, we have an adapter/device/adapterformat/backbufferformat/iswindowed
                        // DeviceCombo that is supported by the system and acceptable to the app. We still 
                        // need to find one or more suitable depth/stencil buffer format,
                        // multisample type, and present interval.

                        EnumDeviceSettingsCombo deviceCombo = new EnumDeviceSettingsCombo();

                        // Store the information
                        deviceCombo.AdapterOrdinal = adapterInfo.AdapterOrdinal;
                        deviceCombo.DeviceType = deviceInfo.DeviceType;
                        deviceCombo.AdapterFormat = adapterFormat;
                        deviceCombo.BackBufferFormat = backbufferFormatsArray[i];
                        deviceCombo.IsWindowed = isWindowedIndex;

                        // Build the depth stencil format and multisample type list
                        BuildDepthStencilFormatList(deviceCombo);
                        BuildMultiSampleTypeList(deviceCombo);
                        if (deviceCombo.multiSampleTypeList.Count == 0)
                        {
                            // Nothing to do
                            continue;
                        }
                        // Build the conflict and present lists

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产精品成人久久综合一区| 日韩高清不卡一区二区三区| 亚洲午夜精品在线| 捆绑调教一区二区三区| 一道本成人在线| 久久综合久久久久88| 视频在线观看一区| 91亚洲精华国产精华精华液| 精品国产91久久久久久久妲己 | 亚洲一区二区三区视频在线播放 | 亚洲影视在线观看| 成人黄页在线观看| 久久久久久97三级| 麻豆精品精品国产自在97香蕉| 色爱区综合激月婷婷| 国产欧美一区二区三区网站| 蜜臂av日日欢夜夜爽一区| 91国偷自产一区二区三区观看 | 精品国免费一区二区三区| 午夜视黄欧洲亚洲| 欧美午夜精品免费| 一区2区3区在线看| 色94色欧美sute亚洲线路二| 综合分类小说区另类春色亚洲小说欧美 | 国产欧美日韩激情| 国产专区综合网| 国产亚洲精品精华液| 精品一区二区三区日韩| 精品成人在线观看| 韩国女主播成人在线| 久久婷婷一区二区三区| 国产中文字幕一区| 久久精品视频网| 国产成人自拍网| 中国av一区二区三区| 99久久国产综合精品色伊| 亚洲欧美另类综合偷拍| 在线一区二区观看| 亚洲3atv精品一区二区三区| 7777精品伊人久久久大香线蕉完整版 | 欧美午夜片在线观看| 污片在线观看一区二区| 欧美一级国产精品| 国产精品白丝av| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 欧美xxxxx牲另类人与| 激情综合色综合久久| 国产午夜精品一区二区 | 亚洲精品视频在线看| 欧美视频完全免费看| 日本va欧美va精品发布| 欧美精品一区二区不卡| heyzo一本久久综合| 亚洲午夜电影在线观看| 欧美xxxxx裸体时装秀| 不卡一区二区在线| 亚洲一区在线观看免费| 日韩欧美电影在线| 不卡视频在线看| 爽好久久久欧美精品| 日本一区二区三区dvd视频在线| 99免费精品在线观看| 香蕉乱码成人久久天堂爱免费| 精品国产免费人成在线观看| 色综合久久久久久久久久久| 另类成人小视频在线| 亚洲欧美另类久久久精品| 日韩亚洲欧美一区| 91免费观看视频在线| 美女视频一区在线观看| 最新中文字幕一区二区三区| 欧美一区欧美二区| 91视视频在线直接观看在线看网页在线看| 性做久久久久久久免费看| 亚洲国产精品精华液2区45| 欧美日韩国产一级片| 国产99久久久国产精品潘金| 亚洲成av人片在线| 日韩美女视频一区二区| 久久综合色综合88| 欧美日韩精品一区二区在线播放| 国产综合久久久久影院| 午夜精品久久久久久久99水蜜桃| 欧美激情一区二区三区四区| 日韩亚洲欧美一区| 欧美日韩视频第一区| 91丝袜国产在线播放| 国产福利91精品| 久久精品国产亚洲5555| 丝瓜av网站精品一区二区| 亚洲欧洲成人自拍| 国产色一区二区| 精品国产一区a| 日韩欧美在线一区二区三区| 欧美在线观看一区| 色综合视频一区二区三区高清| 国产一区二区影院| 激情综合网最新| 日本vs亚洲vs韩国一区三区| 亚洲bdsm女犯bdsm网站| 亚洲国产精品视频| 亚洲1区2区3区视频| 亚洲成人午夜电影| 亚洲第一狼人社区| 亚洲图片欧美色图| 亚洲国产精品嫩草影院| 亚洲综合在线五月| 一区二区三区四区视频精品免费| 中文字幕欧美一区| 亚洲欧美日韩国产一区二区三区 | 久久久久久久精| 久久影院午夜论| 国产亚洲精品久| 国产精品卡一卡二| 亚洲人成网站在线| 夜夜精品浪潮av一区二区三区| 亚洲另类在线制服丝袜| 一区二区三区鲁丝不卡| 亚洲国产精品久久久久秋霞影院| 一区二区三区四区中文字幕| 亚洲伊人色欲综合网| 日韩激情中文字幕| 看电视剧不卡顿的网站| 国产麻豆精品在线观看| 成人免费视频一区二区| 99视频精品全部免费在线| 在线免费观看视频一区| 欧美久久久久久蜜桃| 欧美一区二区人人喊爽| 久久一区二区三区四区| 中文字幕一区二区三区在线不卡 | 国产盗摄女厕一区二区三区| heyzo一本久久综合| 欧美伊人精品成人久久综合97 | 99r国产精品| 欧美日韩极品在线观看一区| 欧美另类videos死尸| 久久看人人爽人人| 一区二区在线观看免费| 青青草原综合久久大伊人精品| 九九九精品视频| 成人午夜在线免费| 欧美精品自拍偷拍动漫精品| 26uuu国产电影一区二区| 国产精品久久看| 视频在线观看91| 成人av在线播放网站| 欧美日本在线看| 国产日韩欧美不卡在线| 亚洲一二三四区不卡| 国产一区二区三区日韩 | 三级在线观看一区二区 | 欧美日韩一区二区三区四区 | 国产成人精品综合在线观看| 欧美色图在线观看| 欧美激情一区二区三区在线| 日韩影院精彩在线| 99精品在线观看视频| 日韩欧美国产一二三区| 亚洲综合另类小说| 国产不卡在线视频| 欧美疯狂做受xxxx富婆| 综合网在线视频| 国产美女久久久久| 欧美精品久久久久久久多人混战| 国产精品午夜在线观看| 美女免费视频一区二区| 欧美三级蜜桃2在线观看| 中文成人av在线| 国产一区二区女| 91精品婷婷国产综合久久竹菊| 国产精品精品国产色婷婷| 国产伦精品一区二区三区在线观看| 日本韩国精品在线| ...av二区三区久久精品| 国产成人自拍在线| 精品国免费一区二区三区| 日韩高清国产一区在线| 欧美在线观看视频在线| 亚洲精品v日韩精品| av在线播放一区二区三区| 久久精品日韩一区二区三区| 久久福利视频一区二区| 日韩精品一区二区三区视频 | 成人黄色软件下载| 久久综合狠狠综合久久综合88| 免费看日韩精品| 欧美一卡2卡3卡4卡| 丝袜亚洲精品中文字幕一区| 欧美影片第一页| 一区二区三区**美女毛片| 91色在线porny| 亚洲美女偷拍久久| 一本色道久久综合精品竹菊| 亚洲三级在线观看| 91丨九色丨国产丨porny| 亚洲精品国产a久久久久久 | 精品国精品国产尤物美女| 美腿丝袜亚洲三区| 日韩精品一区二区三区在线观看|