mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 04:53:29 +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();
|
||||
this.game = new GameImpl();
|
||||
// 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
|
||||
this.game.OnLoadContent += game => game.InputHandler.HandleMouse = false;
|
||||
this.view = this.game.Services.GetService(typeof(View)) as View;
|
||||
|
|
|
@ -39,8 +39,8 @@ namespace MLEM.Extensions {
|
|||
manager.ApplyChanges();
|
||||
}
|
||||
|
||||
public static void ResetWidthAndHeight(this GraphicsDeviceManager manager, Game game) {
|
||||
var (_, _, width, height) = game.Window.ClientBounds;
|
||||
public static void ResetWidthAndHeight(this GraphicsDeviceManager manager, GameWindow window) {
|
||||
var (_, _, width, height) = window.ClientBounds;
|
||||
manager.PreferredBackBufferWidth = Math.Max(height, width);
|
||||
manager.PreferredBackBufferHeight = Math.Min(height, width);
|
||||
manager.ApplyChanges();
|
||||
|
|
Loading…
Reference in a new issue