zoukankan      html  css  js  c++  java
  • xna全屏切换

    这段代码可以让我们的视窗以当前的分辨率进行全屏切换。

     1 private void ToggleFullScreen()
     2         {
     3             PresentationParameters presentation =
     4                 graphics.GraphicsDevice.PresentationParameters;
     5             if (presentation.IsFullScreen)
     6             {    
     7                 graphics.PreferredBackBufferWidth = 800;
     8                 graphics.PreferredBackBufferHeight = 600;
     9                 Window.AllowUserResizing = false;
    10             }
    11             else
    12             {
    13                 GraphicsAdapter adapter = graphics.GraphicsDevice.CreationParameters.Adapter;
    14                 graphics.PreferredBackBufferWidth = adapter.CurrentDisplayMode.Width;
    15                 graphics.PreferredBackBufferHeight = adapter.CurrentDisplayMode.Height;
    16             }
    17             graphics.ToggleFullScreen();

    18         } 

  • 相关阅读:
    递归方程(续)
    递推方程
    协方差简单介绍
    排列组合
    牛顿法
    jquery常用方法总结
    RegExp的test()方法
    localStorage用法总结
    正则表达式
    登录页面按回车键实现登陆效果
  • 原文地址:https://www.cnblogs.com/fhmsha/p/1589249.html
Copyright © 2011-2022 走看看