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

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

?? dxmut.cs

?? VC中使用C#作為腳本引擎編程
?? CS
?? 第 1 頁 / 共 5 頁
字號(hào):
//--------------------------------------------------------------------------------------
// File: DXMUT.cs
//
// DirectX SDK Managed Direct3D sample framework
//
// 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>
    /// Managed Utility Framework Class
    /// </summary>
    public sealed class Framework : IDisposable
    {

        #region Class Data
        // Constants for command line arguments
        private const string CmdAdapter = "adapter";
        private const string CmdWindowed = "windowed";
        private const string CmdFullscreen = "fullscreen";
        private const string CmdForceHardware = "forcehal";
        private const string CmdForceRef = "forceref";
        private const string CmdPureHwVp = "forcepurehwvp";
        private const string CmdForceHwVp = "forcehwvp";
        private const string CmdForceSwVp = "forceswvp";
        private const string CmdWidth = "width";
        private const string CmdHeight = "height";
        private const string CmdStartx = "startx";
        private const string CmdStarty = "starty";
        private const string CmdConstantFrame = "constantframetime";
        private const string CmdQuitAfterFrame = "quitafterframe";
        private const string CmdNoErrorBoxes = "noerrormsgboxes";

        // Delegate used for disposing application
        private delegate void DisposeDelegate();

        // Constants for minimum window size
        private const int MinimumWindowSizeX = 200;
        private const int MinimumWindowSizeY = 200;
        public const int DefaultSizeWidth = 640;
        public const int DefaultSizeHeight = 480;
        // Default starting size
        private static readonly System.Drawing.Size DefaultStartingSize = new System.Drawing.Size(DefaultSizeWidth, DefaultSizeHeight);
        internal static readonly System.Drawing.Size MinWindowSize = new System.Drawing.Size(MinimumWindowSizeX, MinimumWindowSizeY);
        public static readonly IntPtr TrueIntPtr = new IntPtr(1);
        private const string WindowClassName = "ManagedDirect3DWindowClass";

        // What about the stored data?
        private FrameworkData State;
        // Last shown error
        private Exception lastDisplayedMessage = null;
        // Has the framework been disposed already
        private bool isDisposed = false;
        // Did the toggle fullscreen happen when maximized?
        private bool toggleMaximized = false;
        #endregion

        #region Creation 
        /// <summary>
        /// Constructor, init data here
        /// </summary>
        public Framework()
        {
            State = new FrameworkData();
        }
        #endregion

        #region Setting up callbacks
        // Interface 'callbacks'
        public void SetCallbackInterface(IFrameworkCallback callback) { State.CallbackInterface = callback; }
        public void SetDeviceCreationInterface(IDeviceCreation callback) { State.DeviceCreationInterface = callback; }

        // Event 'callbacks'

        /// <summary>The event fired for disposing of the device</summary>
        public event EventHandler Disposing; 
        /// <summary>The event fired for when the device is lost</summary>
        public event EventHandler DeviceLost; 
        /// <summary>The event fired for when the device is created</summary>
        public event DeviceEventHandler DeviceCreated; 
        /// <summary>The event fired for when the device is reset</summary>
        public event DeviceEventHandler DeviceReset; 

        public void SetWndProcCallback(WndProcCallback callback) { State.WndProcFunction = callback; }
        #endregion

        /// <summary>
        /// Optionally parses the command line and sets if default hotkeys are handled
        /// Possible command line parameters are:
        /// -adapter:#              forces app to use this adapter # (fails if the adapter doesn't exist)
        /// -windowed               forces app to start windowed
        /// -fullscreen             forces app to start full screen
        /// -forceHardware          forces app to use Hardware (fails if Hardware doesn't exist)
        /// -forceReference         forces app to use Reference (fails if Reference doesn't exist)
        /// -forcepurehwvp          forces app to use pure HWVP (fails if device doesn't support it)
        /// -forcehwvp              forces app to use HWVP (fails if device doesn't support it)
        /// -forceswvp              forces app to use SWVP 
        /// -width:#                forces app to use # for width. for full screen, it will pick the closest possible supported mode
        /// -height:#               forces app to use # for height. for full screen, it will pick the closest possible supported mode
        /// -startx:#               forces app to use # for the x coord of the window position for windowed mode
        /// -starty:#               forces app to use # for the y coord of the window position for windowed mode
        /// -constantframetime:#    forces app to use constant frame time, where # is the time/frame in seconds
        /// -quitafterframe:x       forces app to quit after # frames
        /// -noerrormsgboxes        prevents the display of message boxes generated by the framework so the application can be run without user interaction
        /// 
        /// Hotkeys handled by default are:
        /// ESC                 app exits
        /// Alt-Enter           toggle between full screen & windowed
        /// F2 			        device selection dialog
        /// F3 			        toggle Hardware/Reference
        /// F8                  toggle wire-frame mode
        /// Pause               pauses time
        /// </summary>
        public void Initialize(bool isParsingCommandLine, bool handleDefaultKeys, bool showMessageBoxOnError)
        {
            State.WasInitCalled = true;

            // Turn off event handling for the MDX runtime, this will
            // increase performance and remove potential working set issues
            Device.IsUsingEventHandlers = false;

            // Increase

            // Store this data
            State.IsShowingMsgBoxOnError = showMessageBoxOnError;
            State.IsHandlingDefaultHotkeys = handleDefaultKeys;

            // Reset the timer period (ignore any failures)
            try
            { NativeMethods.timeBeginPeriod(1); }
            catch { System.Diagnostics.Debugger.Log(9, string.Empty, "Could not set time period.\r\n" ); }

            if (isParsingCommandLine)
            {
                ParseCommandLine();
            }

            // Reset the timer
            FrameworkTimer.Reset();
            State.IsInited = true;

        }

        /// <summary>
        /// Parses the command line for parameters.  See Initialize() for list 
        /// </summary>
        private void ParseCommandLine()
        {
            string[] args = System.Environment.GetCommandLineArgs(); // Ignore the first one since that's the executable name

            // Go through each argument, skipping the first one
            for (int i = 1; i < args.Length; i++)
            {
                string argument = string.Empty;
                if ((args[i].StartsWith("-")) || (args[i].StartsWith("-")))
                {
                    argument = args[i].Substring(1, args[i].Length - 1);
                }
                else
                    continue;

                if (argument.ToLower().StartsWith(CmdAdapter + ":"))
                {
                    try
                    { State.OverrideAdapterOrdinal = int.Parse(argument.Substring(CmdAdapter.Length + 1, argument.Length - (CmdAdapter.Length + 1))); }
                    catch (FormatException){}
                }
                else if (string.Compare(argument, CmdWindowed, true) == 0)
                {
                    State.IsOverridingWindowed = true;
                }
                else if (string.Compare(argument, CmdFullscreen, true) == 0)
                {
                    State.IsOverridingFullScreen = true;
                }
                else if (string.Compare(argument, CmdForceHardware, true) == 0)
                {
                    State.IsOverridingForceHardware = true;
                }
                else if (string.Compare(argument, CmdForceRef, true) == 0)
                {
                    State.IsOverridingForceReference = true;
                }
                else if (string.Compare(argument, CmdPureHwVp, true) == 0)
                {
                    State.IsOverridingForcePureHardwareVertexProcessing = true;
                }
                else if (string.Compare(argument, CmdForceHwVp, true) == 0)
                {
                    State.IsOverridingForceHardwareVertexProcessing = true;
                }
                else if (string.Compare(argument, CmdForceSwVp, true) == 0)
                {
                    State.IsOverridingForceSoftwareVertexProcessing = true;
                }
                else if (argument.ToLower().StartsWith(CmdWidth + ":"))
                {
                    try
                    { State.OverrideWidth = int.Parse(argument.Substring(CmdWidth.Length + 1, argument.Length - (CmdWidth.Length + 1))); }
                    catch (FormatException){}
                }
                else if (argument.ToLower().StartsWith(CmdHeight + ":"))
                {
                    try
                    { State.OverrideHeight = int.Parse(argument.Substring(CmdHeight.Length + 1, argument.Length - (CmdHeight.Length + 1))); }
                    catch (FormatException){}
                }
                else if (argument.ToLower().StartsWith(CmdStartx + ":"))
                {
                    try
                    { State.OverrideStartX = int.Parse(argument.Substring(CmdStartx.Length + 1, argument.Length - (CmdStartx.Length + 1))); }
                    catch (FormatException){}
                }
                else if (argument.ToLower().StartsWith(CmdStarty + ":"))
                {
                    try
                    { State.OverrideStartY = int.Parse(argument.Substring(CmdStarty.Length + 1, argument.Length - (CmdStarty.Length + 1))); }
                    catch (FormatException){}
                }
                else if (argument.ToLower().StartsWith(CmdConstantFrame + ":"))
                {
                    float timePerFrame = 0.033f; // Default to this time
                    try
                    { 
                        timePerFrame = float.Parse(argument.Substring(CmdConstantFrame.Length + 1, argument.Length - (CmdConstantFrame.Length + 1))); 
                    }
                    catch (FormatException){}
                    State.OverrideConstantTimePerFrame = timePerFrame;
                    State.IsOverridingConstantFrameTime = true;
                }
                else if (argument.ToLower().StartsWith(CmdQuitAfterFrame + ":"))
                {
                    try
                    { State.OverrideQuitAfterFrame = int.Parse(argument.Substring(CmdQuitAfterFrame.Length + 1, argument.Length - (CmdQuitAfterFrame.Length + 1))); }
                    catch (FormatException){}
                }
                else if (string.Compare(argument, CmdNoErrorBoxes, true) == 0)
                {
                    State.IsShowingMsgBoxOnError = false;
                }
                else
                    System.Diagnostics.Debugger.Log(9, string.Empty, string.Format("Unrecognized flag: {0}\r\n", argument));
            }
        }

        /// <summary>
        /// Creates a window with the specified title, icon, menu, and starting position.  If Init hasn't been
        /// called, this will call with default params.  Instead of calling this, you can call SetWindow
        /// to use an existing window
        /// </summary>
        public void CreateWindow(string windowTitle, System.Drawing.Icon icon, 
            System.Windows.Forms.MainMenu menu, int x, int y)
        {
            if (State.IsInsideDeviceCallback)
                throw new InvalidOperationException("You cannot create a window from inside a callback.");

            State.WasWindowCreateCalled = true;
            // Are we inited?
            if (!State.IsInited)
            {
                // If Init was already called and failed, fail again
                if (State.WasInitCalled)
                {
                    throw new InvalidOperationException("Initialize was already called and failed.");
                }

                // Call initialize with default params
                Initialize(true, true, true);
            }

            // Is there already a window created?
            if (State.WindowFocus == null)
            {

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人免费视频视频| 国产亚洲精品资源在线26u| 中文字幕在线不卡一区二区三区| 久久国产婷婷国产香蕉| 精品少妇一区二区三区日产乱码 | 欧美成人aa大片| 国产老肥熟一区二区三区| 欧美午夜免费电影| 久久9热精品视频| 国产日韩影视精品| 91久久国产最好的精华液| 亚洲高清免费观看高清完整版在线观看| 欧美日韩一区视频| 麻豆极品一区二区三区| 亚洲欧洲精品一区二区三区| 欧美羞羞免费网站| 国产精品一区二区无线| 午夜天堂影视香蕉久久| 国产亚洲精品免费| 日本久久一区二区| 国内外成人在线视频| 国产精品盗摄一区二区三区| 69精品人人人人| 99久久婷婷国产| 美女在线观看视频一区二区| 国产精品久久久久9999吃药| 欧美一区二区三区电影| 色呦呦一区二区三区| 国产精品一线二线三线| 美女免费视频一区| 亚洲电影一区二区三区| 国产精品女人毛片| 精品999久久久| 日韩精品一区二区三区蜜臀| 欧美日韩久久一区二区| 97精品电影院| 99久久精品国产网站| 不卡电影一区二区三区| 国产精品 欧美精品| 国产精品一区久久久久| 国产精品原创巨作av| 国产专区综合网| 成人一级黄色片| 久久不见久久见免费视频1| 手机精品视频在线观看| 亚洲小说欧美激情另类| 国产精品萝li| 亚洲猫色日本管| 一区二区三区在线播| 亚洲国产另类av| 亚洲国产美女搞黄色| 亚洲国产成人tv| 亚洲一二三区在线观看| 夜夜嗨av一区二区三区四季av| 一区二区三区四区高清精品免费观看 | 欧美一级日韩免费不卡| 欧美精品v国产精品v日韩精品| 欧美精三区欧美精三区| 欧美一区二区三区视频在线观看| 欧美日本视频在线| 26uuu国产一区二区三区| 热久久免费视频| 日韩国产欧美在线播放| 国产精品1区2区3区在线观看| av在线不卡网| 日韩久久免费av| 久久久噜噜噜久久中文字幕色伊伊| 国产精品久久久久久久久搜平片 | 99精品视频免费在线观看| 欧美亚洲禁片免费| 欧美大片顶级少妇| 337p亚洲精品色噜噜噜| 国产日本欧美一区二区| 秋霞电影一区二区| av成人动漫在线观看| 欧美一区二区三区视频免费| 亚洲欧洲一区二区三区| 久久久久99精品一区| 欧美精品久久99| 日本一区二区视频在线观看| 性感美女极品91精品| 99久久伊人久久99| 久久人人爽人人爽| 久久精品国产77777蜜臀| 在线欧美日韩国产| 亚洲精品国产一区二区精华液 | 欧美性色综合网| 欧美韩日一区二区三区四区| 五月天亚洲婷婷| 欧美裸体bbwbbwbbw| 亚洲综合激情另类小说区| 91免费看视频| 一区二区在线免费观看| 色呦呦国产精品| 亚洲免费成人av| 欧洲另类一二三四区| 亚洲国产aⅴ天堂久久| 欧美日韩国产系列| 婷婷开心久久网| 欧美一区二区三区视频免费播放| 日韩福利电影在线观看| 欧美成人精品二区三区99精品| 蜜臀精品一区二区三区在线观看 | 色诱亚洲精品久久久久久| 亚洲视频小说图片| 色婷婷激情综合| 亚洲一区视频在线| 精品福利一二区| 波多野结衣亚洲一区| 亚洲国产精品一区二区久久| 欧美一区二区三区思思人| 国产精品99久久久久久似苏梦涵 | 国产高清不卡一区| 一区二区三区四区视频精品免费 | 日韩精品专区在线影院观看| 国产成人自拍高清视频在线免费播放| 国产精品乱码妇女bbbb| 91精品国产综合久久久蜜臀图片| 久久国产视频网| 一二三区精品福利视频| 亚洲精品一区二区三区99| 在线免费精品视频| 国产99久久久国产精品潘金| 午夜成人免费视频| 中文字幕五月欧美| 久久亚洲一区二区三区四区| 日本电影亚洲天堂一区| 成人爱爱电影网址| 国产福利不卡视频| 日韩影视精彩在线| 亚洲国产精品久久不卡毛片| 中文字幕成人网| 久久九九久久九九| 日韩一区二区三区电影在线观看| 欧美韩日一区二区三区四区| 色欧美88888久久久久久影院| 国产成人午夜电影网| 美女精品一区二区| 国产成人丝袜美腿| 免费日本视频一区| 欧美a一区二区| 全国精品久久少妇| 麻豆91免费观看| 久久99久久精品| 国产一区二区三区美女| 国产九九视频一区二区三区| 国产乱人伦偷精品视频免下载| 国产乱码精品一区二区三区av| 国产 欧美在线| 99精品久久只有精品| 在线观看免费一区| 在线成人av网站| 精品国精品自拍自在线| 一本大道久久a久久精品综合| 日韩国产欧美在线视频| 蜜桃视频在线一区| 国产精品白丝jk白祙喷水网站| 成人av网站免费观看| 色88888久久久久久影院野外| 久久av资源网| 亚洲成年人网站在线观看| 亚洲h精品动漫在线观看| 精品影视av免费| 91在线无精精品入口| 7777精品伊人久久久大香线蕉 | 色久综合一二码| 91精品久久久久久久91蜜桃| 欧美国产禁国产网站cc| 亚洲制服丝袜一区| 国产在线日韩欧美| 欧美天天综合网| 自拍偷拍亚洲欧美日韩| 色婷婷综合久久久中文一区二区| 日韩精品一区国产麻豆| 欧美国产在线观看| 人人狠狠综合久久亚洲| 日本高清无吗v一区| 日韩一区二区电影| 亚洲图片有声小说| 波多野结衣精品在线| 欧美国产精品中文字幕| 日本人妖一区二区| 欧美日韩国产高清一区二区三区 | 精品一区二区三区欧美| 欧美日韩国产在线观看| 亚洲另类春色国产| 91亚洲精品久久久蜜桃网站| 欧美国产精品专区| 成人手机电影网| 中文字幕免费不卡| 99精品视频一区| 依依成人精品视频| 欧美日韩免费一区二区三区| 亚洲一区二区不卡免费| 欧美人狂配大交3d怪物一区| 午夜电影网一区| 久久精品网站免费观看| 99热99精品| 亚洲精品中文字幕乱码三区| 精品视频一区二区不卡|