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         } 

  • 相关阅读:
    VS2013 自动添加头部注释 -C#开发
    在调用Response.End()时,会执行Thread.CurrentThread.Abort()操作
    React
    WebApi基础
    wcf
    memcached系列
    Ioc容器Autofac系列
    使用TortoiseSVN创建版本库
    使用libcurl 发送post请求
    值得推荐的C/C++框架和库
  • 原文地址:https://www.cnblogs.com/fhmsha/p/1589249.html
Copyright © 2011-2022 走看看