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

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

?? d3dapp.cs

?? Particle System Test Application on C#
?? CS
?? 第 1 頁 / 共 4 頁
字號:
        presentParams.MultiSample = graphicsSettings.MultisampleType;
        presentParams.MultiSampleQuality = graphicsSettings.MultisampleQuality;
        presentParams.SwapEffect = SwapEffect.Discard;
        presentParams.EnableAutoDepthStencil = enumerationSettings.AppUsesDepthBuffer;
        presentParams.AutoDepthStencilFormat = graphicsSettings.DepthStencilBufferFormat;
        presentParams.PresentFlag = PresentFlag.None;

        if (windowed)
        {
            presentParams.BackBufferWidth  = ourRenderTarget.ClientRectangle.Right - ourRenderTarget.ClientRectangle.Left;
            presentParams.BackBufferHeight = ourRenderTarget.ClientRectangle.Bottom - ourRenderTarget.ClientRectangle.Top;
            presentParams.BackBufferFormat = graphicsSettings.DeviceCombo.BackBufferFormat;
            presentParams.FullScreenRefreshRateInHz = 0;
            presentParams.PresentationInterval = PresentInterval.Immediate;
            presentParams.DeviceWindow = ourRenderTarget;
        }
        else
        {
            presentParams.BackBufferWidth  = graphicsSettings.DisplayMode.Width;
            presentParams.BackBufferHeight = graphicsSettings.DisplayMode.Height;
            presentParams.BackBufferFormat = graphicsSettings.DeviceCombo.BackBufferFormat;
            presentParams.FullScreenRefreshRateInHz = graphicsSettings.DisplayMode.RefreshRate;
            presentParams.PresentationInterval = graphicsSettings.PresentInterval;
            presentParams.DeviceWindow = this;
        }
    }




    /// <summary>
    /// Initialize the graphics environment
    /// </summary>
    public void InitializeEnvironment()
    {
        GraphicsAdapterInfo adapterInfo = graphicsSettings.AdapterInfo;
        GraphicsDeviceInfo deviceInfo = graphicsSettings.DeviceInfo;

        windowed = graphicsSettings.IsWindowed;

        // Set up the presentation parameters
        BuildPresentParamsFromSettings();

        if (deviceInfo.Caps.PrimitiveMiscCaps.IsNullReference)
        {
            // Warn user about null ref device that can't render anything
            HandleSampleException(new NullReferenceDeviceException(), ApplicationMessage.None);
        }

        CreateFlags createFlags = new CreateFlags();
        if (graphicsSettings.VertexProcessingType == VertexProcessingType.Software)
            createFlags = CreateFlags.SoftwareVertexProcessing;
        else if (graphicsSettings.VertexProcessingType == VertexProcessingType.Mixed)
            createFlags = CreateFlags.MixedVertexProcessing;
        else if (graphicsSettings.VertexProcessingType == VertexProcessingType.Hardware)
            createFlags = CreateFlags.HardwareVertexProcessing;
        else if (graphicsSettings.VertexProcessingType == VertexProcessingType.PureHardware)
        {
            createFlags = CreateFlags.HardwareVertexProcessing | CreateFlags.PureDevice;
        }
        else
            throw new ApplicationException();
#if (DX9)
#else
        // Make sure to allow multithreaded apps if we need them
        presentParams.ForceNoMultiThreadedFlag = !isMultiThreaded;
#endif
        try
        {
            // Create the device
            device = new Device(graphicsSettings.AdapterOrdinal, graphicsSettings.DevType, 
                windowed ? ourRenderTarget : this , createFlags, presentParams);

            // Cache our local objects
            renderState = device.RenderState;
            sampleState = device.SamplerState;
            textureStates = device.TextureState;
            // When moving from fullscreen to windowed mode, it is important to
            // adjust the window size after recreating the device rather than
            // beforehand to ensure that you get the window size you want.  For
            // example, when switching from 640x480 fullscreen to windowed with
            // a 1000x600 window on a 1024x768 desktop, it is impossible to set
            // the window size to 1000x600 until after the display mode has
            // changed to 1024x768, because windows cannot be larger than the
            // desktop.
            if (windowed)
            {
                // Make sure main window isn't topmost, so error message is visible
                System.Drawing.Size currentClientSize = this.ClientSize;
                this.Size = this.ClientSize;
                this.SendToBack();
                this.BringToFront();
                this.ClientSize = currentClientSize;
            }

            // Store device Caps
            graphicsCaps = device.DeviceCaps;
            behavior = createFlags;

            System.Text.StringBuilder sb = new System.Text.StringBuilder();

            // Store device description
            if (deviceInfo.DevType == DeviceType.Reference)
                sb.Append("REF");
            else if (deviceInfo.DevType == DeviceType.Hardware)
                sb.Append("HAL");
            else if (deviceInfo.DevType == DeviceType.Software)
                sb.Append("SW");

            BehaviorFlags behaviorFlags = new BehaviorFlags(createFlags);
            if ((behaviorFlags.HardwareVertexProcessing) && 
                (behaviorFlags.PureDevice))
            {
                if (deviceInfo.DevType == DeviceType.Hardware)
                    sb.Append(" (pure hw vp)");
                else
                    sb.Append(" (simulated pure hw vp)");
            }
            else if (behaviorFlags.HardwareVertexProcessing)
            {
                if (deviceInfo.DevType == DeviceType.Hardware)
                    sb.Append(" (hw vp)");
                else
                    sb.Append(" (simulated hw vp)");
            }
            else if (behaviorFlags.MixedVertexProcessing)
            {
                if (deviceInfo.DevType == DeviceType.Hardware)
                    sb.Append(" (mixed vp)");
                else
                    sb.Append(" (simulated mixed vp)");
            }
            else if (behaviorFlags.SoftwareVertexProcessing)
            {
                sb.Append(" (sw vp)");
            }

            if (deviceInfo.DevType == DeviceType.Hardware)
            {
                sb.Append(": ");
                sb.Append(adapterInfo.AdapterDetails.Description);
            }

            // Set device stats string
            deviceStats = sb.ToString();

            // Set up the fullscreen cursor
            if (showCursorWhenFullscreen && !windowed)
            {
                System.Windows.Forms.Cursor ourCursor = this.Cursor;
                device.SetCursor(ourCursor, true);
                device.ShowCursor(true);
            }

            // Confine cursor to fullscreen window
            if (clipCursorWhenFullscreen)
            {
                if (!windowed)
                {
                    System.Drawing.Rectangle rcWindow = this.ClientRectangle;
                }
            }

            // Setup the event handlers for our device
            device.DeviceLost += new System.EventHandler(this.InvalidateDeviceObjects);
            device.DeviceReset += new System.EventHandler(this.RestoreDeviceObjects);
            device.Disposing += new System.EventHandler(this.DeleteDeviceObjects);
            device.DeviceResizing += new System.ComponentModel.CancelEventHandler(this.EnvironmentResized);

            // Initialize the app's device-dependent objects
            try
            {
                InitializeDeviceObjects();
                RestoreDeviceObjects(null, null);
                active = true;
                return;
            }
            catch
            {
                // Cleanup before we try again
                InvalidateDeviceObjects(null, null);
                DeleteDeviceObjects(null, null);
                device.Dispose();
                device = null;
                if (this.Disposing)
                    return;
            }
        }
        catch
        {
            // If that failed, fall back to the reference rasterizer
            if (deviceInfo.DevType == DeviceType.Hardware)
            {
                if (FindBestWindowedMode(false, true))
                {
                    windowed = true;

                    // Make sure main window isn't topmost, so error message is visible
                    System.Drawing.Size currentClientSize = this.ClientSize;
                    this.Size = this.ClientSize;
                    this.SendToBack();
                    this.BringToFront();
                    this.ClientSize = currentClientSize;

                    // Let the user know we are switching from HAL to the reference rasterizer
                    HandleSampleException(null, ApplicationMessage.WarnSwitchToRef);

                    InitializeEnvironment();
                }
            }
        }
    }




    /// <summary>
    /// Displays sample exceptions to the user
    /// </summary>
    /// <param name="e">The exception that was thrown</param>
    /// <param name="Type">Extra information on how to handle the exception</param>
    public void HandleSampleException(SampleException e, ApplicationMessage Type)
    {
        // Build a message to display to the user
        string strMsg = string.Empty;
        if (e != null)
            strMsg = e.Message;

        if (ApplicationMessage.ApplicationMustExit == Type)
        {
            strMsg  += "\n\nThis sample will now exit.";
            System.Windows.Forms.MessageBox.Show(strMsg, this.Text, 
                System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);

            // Close the window, which shuts down the app
            if (this.IsHandleCreated)
                this.Close();
        }
        else
        {
            if (ApplicationMessage.WarnSwitchToRef == Type)
                strMsg = "\n\nSwitching to the reference rasterizer,\n";
                strMsg += "a software device that implements the entire\n";
                strMsg += "Direct3D feature set, but runs very slowly.";

            System.Windows.Forms.MessageBox.Show(strMsg, this.Text, 
                System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
        }
    }




    /// <summary>
    /// Fired when our environment was resized
    /// </summary>
    /// <param name="sender">the device that's resizing our environment</param>
    /// <param name="e">Set the cancel member to true to turn off automatic device reset</param>
    public void EnvironmentResized(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // Check to see if we're closing or changing the form style
        if ((isClosing) || (isChangingFormStyle))
        {
            // We are, cancel our reset, and exit
            e.Cancel = true;
            return;
        }

        // Check to see if we're minimizing and our rendering object
        // is not the form, if so, cancel the resize
        if ((ourRenderTarget != this) && (this.WindowState == System.Windows.Forms.FormWindowState.Minimized))
            e.Cancel = true;

        if (!isWindowActive) 
            e.Cancel = true;

        // Set up the fullscreen cursor
        if (showCursorWhenFullscreen && !windowed)
        {
            System.Windows.Forms.Cursor ourCursor = this.Cursor;
            device.SetCursor(ourCursor, true);
            device.ShowCursor(true);
        }

        // If the app is paused, trigger the rendering of the current frame
        if (false == frameMoving)
        {
            singleStep = true;
            DXUtil.Timer(DirectXTimer.Start);
            DXUtil.Timer(DirectXTimer.Stop);
        }
    }




    /// <summary>
    /// Called when user toggles between fullscreen mode and windowed mode
    /// </summary>
    public void ToggleFullscreen()
    {
        int AdapterOrdinalOld = graphicsSettings.AdapterOrdinal;
        DeviceType DevTypeOld = graphicsSettings.DevType;

        isHandlingSizeChanges = false;
        isChangingFormStyle = true;
        ready = false;

        // Toggle the windowed state
        windowed = !windowed;

        // Save our maximized settings..
        if (!windowed && isMaximized)
            this.WindowState = System.Windows.Forms.FormWindowState.Normal;

        graphicsSettings.IsWindowed = windowed;

        // If AdapterOrdinal and DevType are the same, we can just do a Reset().
        // If they've changed, we need to do a complete device teardown/rebuild.
        if (graphicsSettings.AdapterOrdinal == AdapterOrdinalOld &&
            graphicsSettings.DevType == DevTypeOld)
        {
            BuildPresentParamsFromSettings();
            // Resize the 3D device
        RETRY:
            try
            {
                device.Reset(presentParams);
            }
            catch 
            {
                if (windowed)
                    ForceWindowed();
                else
                {
                    // Sit in a loop until the device passes Reset()
                    try
                    {
                        device.TestCooperativeLevel();
                    }
                    catch(DeviceNotResetException)
                    {
                        // Device still needs to be Reset. Try again.
                        // Yield some CPU time to other processes
                        System.Threading.Thread.Sleep(100); // 100 milliseconds
                        goto RETRY;
                    }
                }
            }
            EnvironmentResized(device, new System.ComponentModel.CancelEventArgs());
        }
        else
        {
            device.Dispose();
            device = null;
            InitializeEnvironment();
        }

        // When moving from fullscreen to windowed mode, it is important to
        // adjust the window size after resetting the device rather than
        // beforehand to ensure that you get the window size you want.  For
        // example, when switching from 640x480 fullscreen to windowed with
        // a 1000x600 window on a 1024x768 desktop, it is impossible to set
        // the window size to 1000x600 until after the display mode has
        // changed to 1024x768, because windows cannot be larger than the
        // desktop.

        if (windowed)
        {
            // if our render target is the main window and we haven't said 
            // ignore the menus, add our menu
            if ((ourRenderTarget == this) && (isUsingMenus))
                this.Menu = mnuMain;
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable;
            isChangingFormStyle = false;

            // We were maximized, restore that state
            if (isMaximized)
            {
                this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
            }
            this.SendToBack();
            this.BringToFront();
            this.ClientSize = storedSize;
            this.Location = storedLocation;
        }
        else
        {
            if (this.Menu != null)
                this.Menu = null;

            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            isChangingFormStyle = false;
        }
        isHandlingSizeChanges = true;
        ready = true;
    }




    /// <summary>
    /// Switch to a windowed mode, even if that means picking a new device and/or adapter
    /// </summary>
    public void ForceWindowed()
    {
        if (windowed)
            return;

        if (!FindBestWindowedMode(false, false))
        {
            return;
        }
        windowed = true;

        // Now destroy the current 3D device objects, then reinitialize

        ready = false;

        // Release display objects, so a new device can be created
        device.Dispose();
        device = null;

        // Create the new device
        try
        {
            InitializeEnvironment();
        }
        catch (SampleException e)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美色精品天天在线观看视频| 久久se精品一区二区| 欧美精品日韩综合在线| 高清视频一区二区| 美国十次了思思久久精品导航| 天天色图综合网| 亚洲与欧洲av电影| 亚洲男人的天堂在线观看| 日本一区二区成人| 国产精品久久一卡二卡| 国产精品丝袜一区| 日韩一区有码在线| 亚洲不卡av一区二区三区| 亚洲自拍另类综合| 97精品久久久久中文字幕 | 久久影视一区二区| 欧美电影免费观看完整版| 日韩午夜在线影院| 中文一区二区完整视频在线观看| 天堂在线亚洲视频| 国产精品一区在线| caoporm超碰国产精品| 欧美综合久久久| 欧美麻豆精品久久久久久| 亚洲人午夜精品天堂一二香蕉| 国产精品一区免费在线观看| 精品美女一区二区| 亚洲色图欧洲色图婷婷| 日韩和的一区二区| 另类小说综合欧美亚洲| 欧美日韩国产一级二级| 久久综合九色综合欧美就去吻| 青草av.久久免费一区| 国产91丝袜在线播放| 久久综合国产精品| 经典三级在线一区| 日本高清不卡视频| 精品国产乱码久久久久久蜜臀| 国产人久久人人人人爽| 一区二区三区四区乱视频| 久久精品免费观看| 久久蜜桃av一区二区天堂| 一区二区三区成人在线视频| 在线亚洲一区二区| 亚洲夂夂婷婷色拍ww47| 欧美日韩高清一区二区三区| 午夜欧美在线一二页| 日韩一区二区在线看| 久久国产麻豆精品| 欧美tickling网站挠脚心| 日韩一本二本av| 中文av一区二区| 日韩一区在线看| 亚洲国产精品久久久久婷婷884| 日本系列欧美系列| 中文字幕日本乱码精品影院| 欧美在线小视频| 欧美一级在线视频| 成熟亚洲日本毛茸茸凸凹| 性做久久久久久免费观看| 国产黄色精品网站| 国产综合久久久久影院| 久久激情五月婷婷| 91成人免费网站| 国产精品久久久久久久蜜臀| 日本最新不卡在线| 制服.丝袜.亚洲.中文.综合| 欧美综合亚洲图片综合区| 亚洲一区二区三区不卡国产欧美| 亚洲国产精品一区二区久久| 成人精品亚洲人成在线| 中文字幕av一区 二区| 亚洲成人免费影院| 精品国产免费人成电影在线观看四季| 国产成人综合在线| 午夜电影久久久| 中文字幕高清不卡| 制服丝袜日韩国产| 成人av电影在线播放| 日韩视频免费观看高清在线视频| 国产一区二区网址| 久久久久99精品国产片| 欧美日韩不卡在线| 丁香婷婷综合色啪| 美脚の诱脚舐め脚责91| 亚洲另类色综合网站| 91在线观看视频| 亚洲国产精品久久久久婷婷884| 国产欧美日韩视频在线观看| 欧美日韩不卡一区| 91网站最新网址| 激情五月激情综合网| 午夜不卡在线视频| 一区二区三区四区不卡在线 | 精品国产三级电影在线观看| 一本色道久久综合亚洲91| 亚洲三级视频在线观看| 久久伊人蜜桃av一区二区| 欧美亚洲丝袜传媒另类| 日韩av一区二区在线影视| 亚洲婷婷国产精品电影人久久| 久久综合久久综合亚洲| 日韩精品一区二区三区中文精品| 欧美日韩一级黄| 在线观看免费亚洲| 91久久精品日日躁夜夜躁欧美| 国产91在线看| 成人美女视频在线观看| 国产精品一品二品| 国产在线精品免费| 国产在线视频一区二区三区| 久久精品国产99久久6| 免费成人性网站| 蜜臀av一区二区在线观看| 蜜桃av噜噜一区二区三区小说| 午夜精品aaa| 午夜电影一区二区三区| 秋霞影院一区二区| 麻豆91免费看| 国产在线观看一区二区| 国产盗摄女厕一区二区三区| 国产精品中文欧美| 成人激情文学综合网| 99久久精品免费| 色天使久久综合网天天| 在线中文字幕一区| 日韩亚洲欧美高清| 精品国产麻豆免费人成网站| 国产亚洲精品福利| 日韩亚洲欧美高清| 久久精品在这里| 国产精品素人视频| 亚洲国产精品一区二区www | 一个色妞综合视频在线观看| 亚洲综合免费观看高清完整版| 亚洲国产精品人人做人人爽| 日韩经典一区二区| 国内精品免费**视频| 国产寡妇亲子伦一区二区| 99久久久国产精品| 欧美精品精品一区| 国产肉丝袜一区二区| 亚洲乱码中文字幕| 蜜臀va亚洲va欧美va天堂| 成人夜色视频网站在线观看| 在线中文字幕一区| 精品国产百合女同互慰| 亚洲日本电影在线| 麻豆91在线播放| 色综合久久99| 日韩精品一区二区在线观看| **欧美大码日韩| 免费观看91视频大全| 99视频热这里只有精品免费| 91麻豆精品91久久久久同性| 久久一留热品黄| 亚洲成人7777| 成人97人人超碰人人99| 91精品国产美女浴室洗澡无遮挡| 国产精品免费av| 七七婷婷婷婷精品国产| aaa欧美日韩| 久久色中文字幕| 日本中文在线一区| 一本到一区二区三区| 久久久久99精品国产片| 日韩成人dvd| 欧美影院一区二区| 中文av一区二区| 极品少妇xxxx精品少妇| 欧美日韩综合色| 中文字幕一区不卡| 国产精品一区二区黑丝| 日韩一级二级三级| 午夜免费欧美电影| 97成人超碰视| 国产精品视频看| 国内精品在线播放| 欧美一级片在线看| 亚洲高清免费观看高清完整版在线观看| 高清shemale亚洲人妖| 精品国精品国产| 婷婷成人综合网| 欧美日韩成人综合天天影院 | 在线视频一区二区三| 亚洲欧洲在线观看av| 国产99久久久久久免费看农村| 日韩视频在线一区二区| 石原莉奈一区二区三区在线观看| 91美女在线看| 一区在线观看免费| 99精品黄色片免费大全| 国产精品色一区二区三区| 国产成人小视频| 久久久久久久久伊人| 国产精品香蕉一区二区三区| www国产精品av| 九色|91porny| 久久久精品tv| 不卡av在线免费观看|