mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 12:58:33 +01:00
actually make this take a window, makes more sense
This commit is contained in:
parent
0ee7f74efd
commit
9db6a52999
2 changed files with 3 additions and 3 deletions
|
@ -27,7 +27,7 @@ namespace Demos.Android {
|
||||||
TextInputWrapper.Current = new TextInputWrapper.Mobile();
|
TextInputWrapper.Current = new TextInputWrapper.Mobile();
|
||||||
this.game = new GameImpl();
|
this.game = new GameImpl();
|
||||||
// reset MlemGame width and height to use device's aspect ratio
|
// reset MlemGame width and height to use device's aspect ratio
|
||||||
this.game.GraphicsDeviceManager.ResetWidthAndHeight(this.game);
|
this.game.GraphicsDeviceManager.ResetWidthAndHeight(this.game.Window);
|
||||||
// disable mouse handling for android to make emulator behavior more coherent
|
// disable mouse handling for android to make emulator behavior more coherent
|
||||||
this.game.OnLoadContent += game => game.InputHandler.HandleMouse = false;
|
this.game.OnLoadContent += game => game.InputHandler.HandleMouse = false;
|
||||||
this.view = this.game.Services.GetService(typeof(View)) as View;
|
this.view = this.game.Services.GetService(typeof(View)) as View;
|
||||||
|
|
|
@ -39,8 +39,8 @@ namespace MLEM.Extensions {
|
||||||
manager.ApplyChanges();
|
manager.ApplyChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ResetWidthAndHeight(this GraphicsDeviceManager manager, Game game) {
|
public static void ResetWidthAndHeight(this GraphicsDeviceManager manager, GameWindow window) {
|
||||||
var (_, _, width, height) = game.Window.ClientBounds;
|
var (_, _, width, height) = window.ClientBounds;
|
||||||
manager.PreferredBackBufferWidth = Math.Max(height, width);
|
manager.PreferredBackBufferWidth = Math.Max(height, width);
|
||||||
manager.PreferredBackBufferHeight = Math.Min(height, width);
|
manager.PreferredBackBufferHeight = Math.Min(height, width);
|
||||||
manager.ApplyChanges();
|
manager.ApplyChanges();
|
||||||
|
|
Loading…
Reference in a new issue