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         } 

  • 相关阅读:
    2016第13周四
    2016第13周周三
    2016第13周二
    2016第13周一
    2016第12周日
    2016第11周五
    2016第11周四
    前端的自我成长
    Java单例模式和volatile关键字
    大约 Apple Metal API 一些想法
  • 原文地址:https://www.cnblogs.com/fhmsha/p/1589249.html
Copyright © 2011-2022 走看看