當前位置: 首頁>>代碼示例>>C#>>正文


C# Framework.PreparingDeviceSettingsEventArgs類代碼示例

本文整理匯總了C#中Microsoft.Xna.Framework.PreparingDeviceSettingsEventArgs的典型用法代碼示例。如果您正苦於以下問題:C# PreparingDeviceSettingsEventArgs類的具體用法?C# PreparingDeviceSettingsEventArgs怎麽用?C# PreparingDeviceSettingsEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PreparingDeviceSettingsEventArgs類屬於Microsoft.Xna.Framework命名空間,在下文中一共展示了PreparingDeviceSettingsEventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: graphics_PreparingDeviceSettings

        void graphics_PreparingDeviceSettings(object sender,
            PreparingDeviceSettingsEventArgs e)
        {

            e.GraphicsDeviceInformation.PresentationParameters.DeviceWindowHandle = drawSurface;

        }
開發者ID:RaulPB,項目名稱:videogames,代碼行數:7,代碼來源:Game1.cs

示例2: graphics_PreparingDeviceSettings

 private void graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
 {
     DisplayMode displayMode = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode;
     e.GraphicsDeviceInformation.PresentationParameters.BackBufferFormat = displayMode.Format;
     e.GraphicsDeviceInformation.PresentationParameters.BackBufferWidth = displayMode.Width;
     e.GraphicsDeviceInformation.PresentationParameters.BackBufferHeight = displayMode.Height;
 }
開發者ID:szyszart,項目名稱:Junkyard,代碼行數:7,代碼來源:Game.cs

示例3: CBeroGraphicsDeviceManager_PreparingDeviceSettings

 void CBeroGraphicsDeviceManager_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
 {
     if (m_WndHndl != IntPtr.Zero)
     {
         e.GraphicsDeviceInformation.PresentationParameters.DeviceWindowHandle = m_WndHndl;
     }
 }
開發者ID:DelBero,項目名稱:XnaScrap,代碼行數:7,代碼來源:CBeroGraphicsDeviceManager.cs

示例4: PreparingDeviceSettings

        private void PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
        {
            PresentationParameters presentationParams = e.GraphicsDeviceInformation.PresentationParameters;

            presentationParams.BackBufferWidth = RenderWidth;
            presentationParams.BackBufferHeight = RenderHeight;
            presentationParams.DeviceWindowHandle = _windowHandle;
            presentationParams.RenderTargetUsage = RenderTargetUsage.PreserveContents;
        }
開發者ID:vchelaru,項目名稱:FlatRedBall,代碼行數:9,代碼來源:FlatRedBallGameBase.cs

示例5: Graphics_PreparingDeviceSettings

        private void Graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
        {
            Graphics.PreferredBackBufferWidth = DefaultResolution.X;
            Graphics.PreferredBackBufferHeight = DefaultResolution.Y;

            //Graphics.GraphicsProfile = GraphicsProfile.HiDef;
            Graphics.SynchronizeWithVerticalRetrace = true;
            //Graphics.PreferredDepthStencilFormat = DepthFormat.Depth24Stencil8;
        }
開發者ID:PokeD,項目名稱:PokeD.SCON,代碼行數:9,代碼來源:EmptyKeysUI.cs

示例6: graphics_PreparingDeviceSettings

 private void graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
 {
     //graphics.IsFullScreen = true;
     graphics.PreferredBackBufferWidth = 1280;
     graphics.PreferredBackBufferHeight = 720;
     graphics.PreferMultiSampling = true;
     graphics.GraphicsProfile = GraphicsProfile.HiDef;
     graphics.PreferredDepthStencilFormat = DepthFormat.Depth24Stencil8;
     graphics.ApplyChanges();
 }
開發者ID:GooDer,項目名稱:descent,代碼行數:10,代碼來源:MainGame.cs

示例7: OnPreparingDeviceSettings

        protected override void OnPreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
        {
            e.GraphicsDeviceInformation.PresentationParameters.PresentationInterval = PresentInterval.One;

            // use 4-bit (per channel) color format for WP7. Atleast Omnia 7 has a horrible banding with SurfaceFormat.Color.
            // Lumia's don't probably have but whatever
            if (OperatingSystemHelper.Version == WindowsPhoneVersion.WP7)
            {
                e.GraphicsDeviceInformation.PresentationParameters.BackBufferFormat = SurfaceFormat.Bgra4444;
            }
        }
開發者ID:JaakkoLipsanen,項目名稱:Skypiea,代碼行數:11,代碼來源:SkypieaGame.cs

示例8: graphics_PreparingDeviceSettings

 void graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
 {
     try
     {
         e.GraphicsDeviceInformation.PresentationParameters.PresentationInterval = PresentInterval.Two;
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
開發者ID:TyrelBaux,項目名稱:Gibbo2D,代碼行數:11,代碼來源:Game1.cs

示例9: GraphicsPreparingDeviceSettings

		private void GraphicsPreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e) {
			var pp = e.GraphicsDeviceInformation.PresentationParameters;
			var adapter = e.GraphicsDeviceInformation.Adapter;

			var dispFormat = adapter.CurrentDisplayMode.Format;
			var dephFormat = pp.DepthStencilFormat;

			SurfaceFormat selectedFormat;
			DepthFormat selectedDepthFormat;
			int selectedMultiSampleCount;
			if (adapter.QueryRenderTargetFormat(GraphicsProfile.HiDef, dispFormat, dephFormat, 4, out selectedFormat, out selectedDepthFormat, out selectedMultiSampleCount)) {
				pp.MultiSampleCount = 4;
			} else if (adapter.QueryRenderTargetFormat(GraphicsProfile.HiDef, dispFormat, dephFormat, 2, out selectedFormat, out selectedDepthFormat, out selectedMultiSampleCount)) {
				pp.MultiSampleCount = 2;
			}

		}
開發者ID:GodLesZ,項目名稱:svn-dump,代碼行數:17,代碼來源:Game1.cs

示例10: graphics_PreparingDeviceSettings

        private void graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
        {
            nativeScreenWidth = graphics.PreferredBackBufferWidth;
            nativeScreenHeight = graphics.PreferredBackBufferHeight;

            if (nativeScreenWidth == 1920)
            {
                graphics.PreferredBackBufferWidth = 1920;
                graphics.PreferredBackBufferHeight = 1080;
            }
            else
            {
                //graphics.PreferredBackBufferWidth = 1920;
                //graphics.PreferredBackBufferHeight = 1080;
                graphics.PreferredBackBufferWidth = 1280;
                graphics.PreferredBackBufferHeight = 720;
                //graphics.IsFullScreen = true;
            }
            graphics.PreferMultiSampling = true;
            graphics.PreferredDepthStencilFormat = DepthFormat.Depth24Stencil8;

            graphics.ApplyChanges();
        }
開發者ID:charbean,項目名稱:StrategyClean,代碼行數:23,代碼來源:StrategyGame.cs

示例11: InitialiseDevice

        private void InitialiseDevice(object sender, PreparingDeviceSettingsEventArgs e)
        {
            PresentationParameters pp =
                e.GraphicsDeviceInformation.PresentationParameters;

            foreach (GraphicsAdapter adapter in GraphicsAdapter.Adapters)
            {             
                if (adapter.Description.Contains("NVIDIA PerfHUD"))
                {
                    GraphicsAdapter.UseReferenceDevice = true;
                    e.GraphicsDeviceInformation.Adapter = adapter;

 
                    break;
                }
            }

            GraphicsAdapter defaultAdapter = GraphicsAdapter.DefaultAdapter;

            //if ( defaultAdapter.IsWideScreen )
                RenderManager.Instance.BaseResolution = new Vector2(1280, 720);
           // else
               // RenderManager.Instance.BaseResolution = new Vector2(1024, 768);
        }
開發者ID:Imortilize,項目名稱:Psynergy-Engine,代碼行數:24,代碼來源:PsynergyApplication.cs

示例12: _graphics_PreparingDeviceSettings

 void _graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
 {
     PresentationParameters pp = e.GraphicsDeviceInformation.PresentationParameters;
     pp.RenderTargetUsage = RenderTargetUsage.PreserveContents;
     e.GraphicsDeviceInformation.PresentationParameters = pp;
 }
開發者ID:Gerjo,項目名稱:Serious-game,代碼行數:6,代碼來源:SeriousGame.cs

示例13: GraphicsPreparingDeviceSettings

 /// <summary>
 /// We need to override this device settings callback so that the correct back buffer it set.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected override void GraphicsPreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
 {
     base.GraphicsPreparingDeviceSettings(sender, e);
     //            e.GraphicsDeviceInformation.PresentationParameters.BackBufferHeight = 960;
     //            e.GraphicsDeviceInformation.PresentationParameters.BackBufferWidth = 800;
 }
開發者ID:Cocos2DXNA,項目名稱:Samples,代碼行數:11,代碼來源:AppDelegate.cs

示例14: GraphicsPreparingDeviceSettings

 protected virtual void GraphicsPreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
 {
     e.GraphicsDeviceInformation.PresentationParameters.RenderTargetUsage = RenderTargetUsage.PreserveContents;
     e.GraphicsDeviceInformation.PresentationParameters.DepthStencilFormat = DepthFormat.Depth24Stencil8;
     e.GraphicsDeviceInformation.PresentationParameters.BackBufferFormat = SurfaceFormat.Color;
 }
開發者ID:CartBlanche,項目名稱:cocos2d-xna,代碼行數:6,代碼來源:CCApplication.cs

示例15: graphics_PreparingDeviceSettings

        private void graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
        {
            nativeScreenWidth = graphics.PreferredBackBufferWidth;
            nativeScreenHeight = graphics.PreferredBackBufferHeight;

            graphics.PreferredBackBufferWidth = 1280;
            graphics.PreferredBackBufferHeight = 720;
            graphics.PreferMultiSampling = true;
            graphics.GraphicsProfile = GraphicsProfile.HiDef;
            graphics.SynchronizeWithVerticalRetrace = true;
            graphics.PreferredDepthStencilFormat = DepthFormat.Depth24Stencil8;
            e.GraphicsDeviceInformation.PresentationParameters.MultiSampleCount = 16;
        }
開發者ID:EmptyKeys,項目名稱:UI_Examples,代碼行數:13,代碼來源:Game1.cs


注:本文中的Microsoft.Xna.Framework.PreparingDeviceSettingsEventArgs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。