本文整理汇总了C#中Microsoft.Xna.Framework.GraphicsDeviceManager.ToggleFullScreen方法的典型用法代码示例。如果您正苦于以下问题:C# GraphicsDeviceManager.ToggleFullScreen方法的具体用法?C# GraphicsDeviceManager.ToggleFullScreen怎么用?C# GraphicsDeviceManager.ToggleFullScreen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Xna.Framework.GraphicsDeviceManager
的用法示例。
在下文中一共展示了GraphicsDeviceManager.ToggleFullScreen方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Configuration
public Configuration(Game game)
: base(game)
{
graphics = new GraphicsDeviceManager(game);
Game_Library.Configuration config = game.Content.Load<Game_Library.Configuration>("Interface/Configuration");
Width = config.Width;
Height = config.Height;
Fullscreen = config.Fullscreen;
if (Fullscreen == true)
{
graphics.PreferredBackBufferWidth = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
graphics.PreferredBackBufferHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;
graphics.ApplyChanges();
if (graphics.IsFullScreen == false)
graphics.ToggleFullScreen();
}
else
{
graphics.PreferredBackBufferHeight = Height;
graphics.PreferredBackBufferWidth = Width;
graphics.ApplyChanges();
if (graphics.IsFullScreen == true)
graphics.ToggleFullScreen();
}
game.Window.ClientSizeChanged += new EventHandler<EventArgs>(OnResize);
}
示例2: FlxFactory
//nothing much to see here, typical XNA initialization code
public FlxFactory()
{
int div = 2;
FlxG.zoom = 1;
#if DEBUGX2
div = 2;
FlxG.zoom = 2;
#endif
#if ! DEBUG
FlxG.zoom = 2;
div = 1;
FlxG.fullscreen = true;
#endif
FlxG.resolutionWidth = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width / div;
FlxG.resolutionHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height / div;
//set up the graphics device and the content manager
_graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
if (FlxG.fullscreen)
{
//resX = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
//resY = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;
if (GraphicsAdapter.DefaultAdapter.IsWideScreen)
{
//if user has it set to widescreen, let's make sure this
//is ACTUALLY a widescreen resolution.
if (((FlxG.resolutionWidth / 16) * 9) != FlxG.resolutionHeight)
{
FlxG.resolutionWidth = (FlxG.resolutionHeight / 9) * 16;
}
}
}
//we don't need no new-fangled pixel processing
//in our retro engine!
_graphics.PreferMultiSampling = false;
//set preferred screen resolution. This is NOT
//the same thing as the game's actual resolution.
_graphics.PreferredBackBufferWidth = FlxG.resolutionWidth;
_graphics.PreferredBackBufferHeight = FlxG.resolutionHeight;
//make sure we're actually running fullscreen if
//fullscreen preference is set.
if (FlxG.fullscreen && _graphics.IsFullScreen == false)
{
_graphics.ToggleFullScreen();
}
_graphics.ApplyChanges();
Console.WriteLine("Running Game at Settings: {0}x{1}\nFullscreen?: {2}\nPreferrred: {3}x{4}", FlxG.resolutionWidth, FlxG.resolutionHeight, FlxG.fullscreen, GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width, GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height);
FlxG.Game = this;
#if !WINDOWS_PHONE
//Components.Add(new GamerServicesComponent(this));
#endif
}
示例3: mainClass
public mainClass()
{
graphics = new GraphicsDeviceManager(this);
graphics.ToggleFullScreen();
CameraPos = new Vector2(272, 5072);
Bounds = new Vector2();
Instance = this;
Content.RootDirectory = "Content";
//Random RNG = new Random();
//for (int i = 0; i < 10; i++)
//{
// if (RNG.Next(100)/(double)100 <= 0.3)
// {
// Console.WriteLine("Yes");
// }
// else
// {
// Console.WriteLine("No");
// }
//}
// Environment.Exit(0);
}
示例4: Game
public Game()
{
if (Constants.FORM_LOAD_ELASUND)
{
#if !DEBUG
FormLoadGame formLoadGame = new FormLoadGame();
formLoadGame.ShowDialog();
if (formLoadGame.DialogResult == System.Windows.Forms.DialogResult.Cancel)
this.Exit();
#endif
}
else
{
Settings.SCREEN_WIDTH = 1024;
Settings.SCREEN_HEIGHT = 768;
Settings.FULL_SCREEN = false;
}
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
graphics.PreferredBackBufferWidth = Settings.SCREEN_WIDTH;
graphics.PreferredBackBufferHeight = Settings.SCREEN_HEIGHT;
this.Window.Title = Constants.NAME_GAME;
if (Settings.FULL_SCREEN)
graphics.ToggleFullScreen();
}
示例5: screenstings
public static void screenstings(GraphicsDeviceManager graphics)
{
KeyboardState kb = Keyboard.GetState() ;
if (kb.IsKeyDown(Keys.F11))
{
graphics.ToggleFullScreen();
}
}
示例6: Game
public Game()
{
graphics = new GraphicsDeviceManager(this);
graphics.ToggleFullScreen();
graphics.PreferredBackBufferHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;
graphics.PreferredBackBufferWidth = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
graphics.ApplyChanges();
Content.RootDirectory = "Content";
}
示例7: Game1
public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
graphics.PreferredBackBufferWidth = 1920;
graphics.PreferredBackBufferHeight = 1080;
graphics.ToggleFullScreen();
}
示例8: Game1
public Game1()
{
graphics = new GraphicsDeviceManager(this);
graphics.PreferredBackBufferHeight = 720;
graphics.PreferredBackBufferWidth = 1280;
graphics.ToggleFullScreen();
Content.RootDirectory = "Content";
Window.Title = "Super Death Ray";
}
示例9: Game1
public Game1()
{
graphics = new GraphicsDeviceManager(this);
graphics.PreferredBackBufferHeight = window_res_y;
graphics.PreferredBackBufferWidth = window_res_x;
if(fullscreen != graphics.IsFullScreen) { graphics.ToggleFullScreen(); }
Content.RootDirectory = "Content";
}
示例10: Game1
public Game1()
{
// ウィンドウの大きさを変更する
GraphicsDeviceManager graphics = new GraphicsDeviceManager(this);
graphics.PreferredBackBufferWidth = ScreenWidth;
graphics.PreferredBackBufferHeight = ScreenHeight;
input = new Input(this);
Content.RootDirectory = "Content";
graphics.ToggleFullScreen();
}
示例11: Game1
public Game1()
{
graphics = new GraphicsDeviceManager(this);
graphics.PreferredBackBufferWidth = width;
graphics.PreferredBackBufferHeight = height;
if (!graphics.IsFullScreen)
graphics.ToggleFullScreen();
Content.RootDirectory = "Content";
}
示例12: Game1
public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
if (Keyboard.GetState().IsKeyDown(Keys.LeftShift))
{
DisplayMode displayMode = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode;
graphics.PreferredBackBufferFormat = displayMode.Format;
graphics.PreferredBackBufferHeight = displayMode.Height;
graphics.PreferredBackBufferWidth = displayMode.Width;
graphics.ToggleFullScreen();
}
}
示例13: Game1
public Game1()
{
graphics = new GraphicsDeviceManager(this);
content = new ContentManager(Services);
system = new ParticleSystem(this);
graphics.PreferredBackBufferWidth = 640;
graphics.PreferredBackBufferHeight = 480;
graphics.PreferMultiSampling = false;
this.IsFixedTimeStep = false;
graphics.SynchronizeWithVerticalRetrace = false;
graphics.ToggleFullScreen();
}
示例14: Game1
public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
storageManager = new StorageManager();
gameConfiguration = storageManager.LoadGameConfiguration();
graphics.PreferredBackBufferWidth = gameConfiguration.Width;
graphics.PreferredBackBufferHeight = gameConfiguration.Height;
if (gameConfiguration.IsFullScreen)
graphics.ToggleFullScreen();
}
示例15: SplashScreen
//Form MyGameForm;
public SplashScreen()
{
clrForBack = clrForSave = Color.Black;
pathToSaveInfoFile = "";
graphics = new GraphicsDeviceManager(this);
graphics.ToggleFullScreen();
Content.RootDirectory = "Content";
// MyGameForm = (Form)Form.FromHandle(this.Window.Handle);
// MyGameForm.FormBorderStyle = FormBorderStyle.None;
moveForwardCursor = 11F;
temp = new Vector2(100, 100);
menuItemEnterInfoButton = menuItemExitButton = menuItemStartButton = Color.Black;
genderForGetInfo = Gender.male;
blink = false;
TimetobBlink = 0;
}