|
|
@ -10,6 +10,8 @@ namespace Jumpy { |
|
|
|
SpriteBatch spriteBatch; |
|
|
|
SpriteFont font; |
|
|
|
KeyboardInput keyboardInput = new KeyboardInput(); |
|
|
|
bool fullScreen = false; |
|
|
|
IWindow window; |
|
|
|
|
|
|
|
public JumpyGame() { |
|
|
|
graphics = new GraphicsDeviceManager(this); |
|
|
@ -18,6 +20,8 @@ namespace Jumpy { |
|
|
|
|
|
|
|
// Performs initialization that's needed before starting to run.
|
|
|
|
protected override void Initialize() { |
|
|
|
window = (IWindow) Services.GetService(typeof(IWindow)); |
|
|
|
window.SetFullScreen(fullScreen, this, graphics); |
|
|
|
base.Initialize(); |
|
|
|
} |
|
|
|
|
|
|
@ -37,10 +41,10 @@ namespace Jumpy { |
|
|
|
keyboardInput.Update(); |
|
|
|
List<Keys> keysDown = keyboardInput.NewKeysDown(); |
|
|
|
|
|
|
|
//if (keysDown.Contains(Keys.F12))
|
|
|
|
//{
|
|
|
|
// SetFullScreen(!fullScreen);
|
|
|
|
//}
|
|
|
|
if (keysDown.Contains(Keys.F12)) { |
|
|
|
window.SetFullScreen(!fullScreen, this, graphics); |
|
|
|
fullScreen = !fullScreen; |
|
|
|
} |
|
|
|
|
|
|
|
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || |
|
|
|
keysDown.Contains(Keys.Escape)) { |
|
|
|