亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
日本不卡在线视频| 中文字幕精品一区二区三区精品| 亚洲综合免费观看高清完整版| 99视频精品全部免费在线| 亚洲欧美另类久久久精品| 色婷婷国产精品综合在线观看| 亚洲在线视频免费观看| 91麻豆精品国产91久久久| 精品一二三四区| 国产精品视频一二三区| 一本色道**综合亚洲精品蜜桃冫| 亚洲精品大片www| 日韩一级片网站| 精品中文av资源站在线观看| 中文天堂在线一区| 日本高清不卡一区| 日韩电影免费在线观看网站| 久久人人爽人人爽| 色婷婷综合久色| 日本不卡一二三区黄网| 国产无遮挡一区二区三区毛片日本| 91日韩精品一区| 久久国产精品72免费观看| 久久一区二区视频| 欧洲色大大久久| 狠狠色丁香婷综合久久| 国产精品久久三| 欧美放荡的少妇| 成人综合婷婷国产精品久久 | 欧美一级日韩免费不卡| 国产在线精品国自产拍免费| 亚洲婷婷国产精品电影人久久| 欧美乱妇20p| 懂色av中文一区二区三区| 亚洲h精品动漫在线观看| 精品国产乱子伦一区| 色哟哟一区二区三区| 国产精品资源在线观看| 亚洲va韩国va欧美va精品 | 国产成人一级电影| 香蕉av福利精品导航| 国产精品人人做人人爽人人添 | 蓝色福利精品导航| 一区二区三区国产豹纹内裤在线| 精品成人佐山爱一区二区| 色偷偷88欧美精品久久久| 国产伦精品一区二区三区在线观看| 亚洲在线成人精品| 国产精品国产三级国产aⅴ原创 | 一本高清dvd不卡在线观看| 久久精品国产精品亚洲综合| 亚洲综合成人在线视频| 国产视频一区在线播放| 欧美xxxx老人做受| 91麻豆精品国产无毒不卡在线观看| 94-欧美-setu| 成人久久视频在线观看| 国产毛片精品视频| 青青国产91久久久久久| 亚洲第一在线综合网站| 成人免费小视频| 中文乱码免费一区二区| 国产欧美综合色| 国产婷婷色一区二区三区 | 国产欧美一区二区精品忘忧草 | 国产一区二区精品久久99| 性欧美疯狂xxxxbbbb| 亚洲精品国产第一综合99久久 | 中文字幕欧美区| 久久日韩粉嫩一区二区三区| 日韩免费看的电影| 日韩一区二区三区在线观看| 正在播放亚洲一区| 欧美日韩国产精选| 欧美探花视频资源| 欧美日韩在线观看一区二区| 欧美日韩在线三区| 在线不卡一区二区| 91麻豆精品国产91久久久久久久久| 欧美肥妇bbw| 日韩一区二区精品在线观看| 日韩一区二区免费视频| wwww国产精品欧美| 久久久久久久久99精品| www国产精品av| 国产精品麻豆久久久| 亚洲欧美日韩在线播放| 一区二区三区日韩| 日韩激情一二三区| 精品亚洲欧美一区| 粉嫩av一区二区三区粉嫩 | 色婷婷av一区二区三区软件| 91福利资源站| 91精品国产高清一区二区三区蜜臀| 欧美一二三四区在线| 精品国产污污免费网站入口 | 精品久久久久久久久久久院品网 | 亚洲精品在线网站| 久久免费电影网| 亚洲男人天堂一区| 午夜久久福利影院| 韩国女主播一区| 91麻豆国产福利在线观看| 欧美日韩三级在线| 精品日韩欧美一区二区| 欧美高清在线一区| 五月婷婷激情综合| 国产成人av一区二区三区在线| 91一区二区三区在线观看| 欧美日韩和欧美的一区二区| 精品久久久三级丝袜| 亚洲欧洲综合另类在线 | 五月综合激情婷婷六月色窝| 韩国精品在线观看| 91麻豆高清视频| www成人在线观看| 亚洲国产一区视频| 国产黄色成人av| 欧美老女人第四色| 久久久国产一区二区三区四区小说 | 欧美日韩免费在线视频| 久久亚洲捆绑美女| 亚洲国产一区二区三区青草影视| 久久97超碰色| 在线看日韩精品电影| 2023国产精品| 亚洲成人av资源| 成人激情动漫在线观看| 91精品欧美一区二区三区综合在| 国产欧美一区二区三区在线看蜜臀 | 亚洲国产日韩av| 日本乱码高清不卡字幕| 日韩欧美色综合| 亚洲另类中文字| 韩国精品主播一区二区在线观看 | 日韩有码一区二区三区| 成人免费的视频| 精品国产污污免费网站入口| 亚洲第四色夜色| 91精品1区2区| 中文字幕一区二区三区乱码在线| 狠狠v欧美v日韩v亚洲ⅴ| 欧美日韩精品一区二区三区四区| 中文字幕 久热精品 视频在线| 日本最新不卡在线| 精品视频一区 二区 三区| 亚洲男女一区二区三区| 大尺度一区二区| 久久久精品综合| 另类小说欧美激情| 91精品国产黑色紧身裤美女| 亚洲成人精品一区二区| a美女胸又www黄视频久久| 日本一区二区视频在线| 国产一区免费电影| 欧美大片在线观看| 久久精品久久综合| 日韩一区二区三区三四区视频在线观看| 亚洲永久免费av| 欧美中文字幕久久| 亚洲最大成人网4388xx| 色噜噜狠狠一区二区三区果冻| 亚洲欧美视频在线观看视频| 91免费观看在线| 亚洲精品伦理在线| 色偷偷久久一区二区三区| 亚洲精品中文字幕在线观看| 色综合久久中文综合久久97| 亚洲欧美色一区| 在线观看精品一区| 亚洲 欧美综合在线网络| 91麻豆精品国产91久久久使用方法 | 一区二区三区免费网站| 色综合网色综合| 亚洲精品福利视频网站| 在线免费不卡电影| 肉肉av福利一精品导航| 欧美一区二区网站| 黄色小说综合网站| 久久婷婷国产综合精品青草| 国产一区二区在线看| 国产亚洲精品久| 成人黄色网址在线观看| 亚洲男人天堂av| 51精品秘密在线观看| 久久www免费人成看片高清| 久久蜜桃av一区二区天堂| 国产成人免费在线观看不卡| 综合在线观看色| 欧美三电影在线| 国产在线精品一区二区不卡了 | 天天综合色天天综合色h| 欧美高清你懂得| 蜜桃视频在线观看一区| www久久久久| 在线一区二区三区四区| 麻豆freexxxx性91精品| 国产精品福利一区| 91麻豆精品国产| 成人激情av网|