forked from MonoGame/MonoGame
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GraphicsDeviceManager.Legacy.cs
659 lines (561 loc) · 24.4 KB
/
GraphicsDeviceManager.Legacy.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
// MonoGame - Copyright (C) The MonoGame Team
// This file is subject to the terms and conditions defined in
// file 'LICENSE.txt', which is part of this source code package.
using System;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input.Touch;
#if WINDOWS_STOREAPP || WINDOWS_UAP
using Windows.UI.Xaml.Controls;
#endif
#if ANDROID
using Android.Views;
#endif
namespace Microsoft.Xna.Framework
{
public class GraphicsDeviceManager : IGraphicsDeviceService, IDisposable, IGraphicsDeviceManager
{
private Game _game;
private GraphicsDevice _graphicsDevice;
private int _preferredBackBufferHeight;
private int _preferredBackBufferWidth;
private SurfaceFormat _preferredBackBufferFormat;
private DepthFormat _preferredDepthStencilFormat;
private bool _preferMultiSampling;
private DisplayOrientation _supportedOrientations;
private bool _synchronizedWithVerticalRetrace = true;
private bool _drawBegun;
bool disposed;
private bool _hardwareModeSwitch = true;
#if (WINDOWS || WINDOWS_UAP) && DIRECTX
private bool _firstLaunch = true;
#endif
#if !WINRT || WINDOWS_UAP
private bool _wantFullScreen = false;
#endif
public static readonly int DefaultBackBufferHeight = 480;
public static readonly int DefaultBackBufferWidth = 800;
public GraphicsDeviceManager(Game game)
{
if (game == null)
throw new ArgumentNullException("The game cannot be null!");
_game = game;
_supportedOrientations = DisplayOrientation.Default;
#if WINDOWS || MONOMAC || DESKTOPGL
_preferredBackBufferHeight = DefaultBackBufferHeight;
_preferredBackBufferWidth = DefaultBackBufferWidth;
#else
// Preferred buffer width/height is used to determine default supported orientations,
// so set the default values to match Xna behaviour of landscape only by default.
// Note also that it's using the device window dimensions.
_preferredBackBufferWidth = Math.Max(_game.Window.ClientBounds.Height, _game.Window.ClientBounds.Width);
_preferredBackBufferHeight = Math.Min(_game.Window.ClientBounds.Height, _game.Window.ClientBounds.Width);
#endif
_preferredBackBufferFormat = SurfaceFormat.Color;
_preferredDepthStencilFormat = DepthFormat.Depth24;
_synchronizedWithVerticalRetrace = true;
GraphicsProfile = GraphicsDevice.GetHighestSupportedGraphicsProfile(null);
if (_game.Services.GetService(typeof(IGraphicsDeviceManager)) != null)
throw new ArgumentException("Graphics Device Manager Already Present");
_game.Services.AddService(typeof(IGraphicsDeviceManager), this);
_game.Services.AddService(typeof(IGraphicsDeviceService), this);
}
~GraphicsDeviceManager()
{
Dispose(false);
}
public void CreateDevice()
{
Initialize();
OnDeviceCreated(EventArgs.Empty);
}
public bool BeginDraw()
{
if (_graphicsDevice == null)
return false;
_drawBegun = true;
return true;
}
public void EndDraw()
{
if (_graphicsDevice != null && _drawBegun)
{
_drawBegun = false;
_graphicsDevice.Present();
}
}
#region IGraphicsDeviceService Members
public event EventHandler<EventArgs> DeviceCreated;
public event EventHandler<EventArgs> DeviceDisposing;
public event EventHandler<EventArgs> DeviceReset;
public event EventHandler<EventArgs> DeviceResetting;
public event EventHandler<PreparingDeviceSettingsEventArgs> PreparingDeviceSettings;
// FIXME: Why does the GraphicsDeviceManager not know enough about the
// GraphicsDevice to raise these events without help?
internal void OnDeviceDisposing(EventArgs e)
{
Raise(DeviceDisposing, e);
}
// FIXME: Why does the GraphicsDeviceManager not know enough about the
// GraphicsDevice to raise these events without help?
internal void OnDeviceResetting(EventArgs e)
{
Raise(DeviceResetting, e);
}
// FIXME: Why does the GraphicsDeviceManager not know enough about the
// GraphicsDevice to raise these events without help?
internal void OnDeviceReset(EventArgs e)
{
Raise(DeviceReset, e);
}
// FIXME: Why does the GraphicsDeviceManager not know enough about the
// GraphicsDevice to raise these events without help?
internal void OnDeviceCreated(EventArgs e)
{
Raise(DeviceCreated, e);
}
private void Raise<TEventArgs>(EventHandler<TEventArgs> handler, TEventArgs e)
where TEventArgs : EventArgs
{
if (handler != null)
handler(this, e);
}
#endregion
#region IDisposable Members
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (!disposed)
{
if (disposing)
{
if (_graphicsDevice != null)
{
_graphicsDevice.Dispose();
_graphicsDevice = null;
}
}
disposed = true;
}
}
#endregion
public void ApplyChanges()
{
// Calling ApplyChanges() before CreateDevice() should have no effect
if (_graphicsDevice == null)
return;
#if WINDOWS_PHONE
_graphicsDevice.GraphicsProfile = GraphicsProfile;
// Display orientation is always portrait on WP8
_graphicsDevice.PresentationParameters.DisplayOrientation = DisplayOrientation.Portrait;
#elif WINDOWS_STOREAPP || WINDOWS_UAP
// TODO: Does this need to occur here?
_game.Window.SetSupportedOrientations(_supportedOrientations);
_graphicsDevice.PresentationParameters.BackBufferFormat = _preferredBackBufferFormat;
_graphicsDevice.PresentationParameters.BackBufferWidth = _preferredBackBufferWidth;
_graphicsDevice.PresentationParameters.BackBufferHeight = _preferredBackBufferHeight;
_graphicsDevice.PresentationParameters.DepthStencilFormat = _preferredDepthStencilFormat;
// TODO: We probably should be resetting the whole device
// if this changes as we are targeting a different
// hardware feature level.
_graphicsDevice.GraphicsProfile = GraphicsProfile;
#if WINDOWS_UAP
_graphicsDevice.PresentationParameters.DeviceWindowHandle = IntPtr.Zero;
_graphicsDevice.PresentationParameters.SwapChainPanel = this.SwapChainPanel;
_graphicsDevice.PresentationParameters.IsFullScreen = _wantFullScreen;
#else
_graphicsDevice.PresentationParameters.IsFullScreen = false;
// The graphics device can use a XAML panel or a window
// to created the default swapchain target.
if (this.SwapChainBackgroundPanel != null)
{
_graphicsDevice.PresentationParameters.DeviceWindowHandle = IntPtr.Zero;
_graphicsDevice.PresentationParameters.SwapChainBackgroundPanel = this.SwapChainBackgroundPanel;
}
else
{
_graphicsDevice.PresentationParameters.DeviceWindowHandle = _game.Window.Handle;
_graphicsDevice.PresentationParameters.SwapChainBackgroundPanel = null;
}
#endif
// Update the back buffer.
_graphicsDevice.CreateSizeDependentResources();
_graphicsDevice.ApplyRenderTargets(null);
#if WINDOWS_UAP
((UAPGameWindow)_game.Window).SetClientSize(_preferredBackBufferWidth, _preferredBackBufferHeight);
#endif
#elif WINDOWS && DIRECTX
_graphicsDevice.PresentationParameters.BackBufferFormat = _preferredBackBufferFormat;
_graphicsDevice.PresentationParameters.BackBufferWidth = _preferredBackBufferWidth;
_graphicsDevice.PresentationParameters.BackBufferHeight = _preferredBackBufferHeight;
_graphicsDevice.PresentationParameters.DepthStencilFormat = _preferredDepthStencilFormat;
_graphicsDevice.PresentationParameters.PresentationInterval = _synchronizedWithVerticalRetrace ? PresentInterval.Default : PresentInterval.Immediate;
_graphicsDevice.PresentationParameters.IsFullScreen = _wantFullScreen;
// TODO: We probably should be resetting the whole
// device if this changes as we are targeting a different
// hardware feature level.
_graphicsDevice.GraphicsProfile = GraphicsProfile;
_graphicsDevice.PresentationParameters.DeviceWindowHandle = _game.Window.Handle;
// Update the back buffer.
_graphicsDevice.CreateSizeDependentResources();
_graphicsDevice.ApplyRenderTargets(null);
((MonoGame.Framework.WinFormsGamePlatform)_game.Platform).ResetWindowBounds();
#elif DESKTOPGL
var displayIndex = Sdl.Window.GetDisplayIndex (SdlGameWindow.Instance.Handle);
var displayName = Sdl.Display.GetDisplayName (displayIndex);
_graphicsDevice.PresentationParameters.BackBufferFormat = _preferredBackBufferFormat;
_graphicsDevice.PresentationParameters.BackBufferWidth = _preferredBackBufferWidth;
_graphicsDevice.PresentationParameters.BackBufferHeight = _preferredBackBufferHeight;
_graphicsDevice.PresentationParameters.DepthStencilFormat = _preferredDepthStencilFormat;
_graphicsDevice.PresentationParameters.PresentationInterval = _synchronizedWithVerticalRetrace ? PresentInterval.Default : PresentInterval.Immediate;
_graphicsDevice.PresentationParameters.IsFullScreen = _wantFullScreen;
//Set the swap interval based on if vsync is desired or not.
//See GetSwapInterval for more details
int swapInterval;
if (_synchronizedWithVerticalRetrace)
swapInterval = _graphicsDevice.PresentationParameters.PresentationInterval.GetSwapInterval();
else
swapInterval = 0;
_graphicsDevice.Context.SwapInterval = swapInterval;
_graphicsDevice.ApplyRenderTargets (null);
_game.Platform.BeginScreenDeviceChange (GraphicsDevice.PresentationParameters.IsFullScreen);
_game.Platform.EndScreenDeviceChange (displayName, GraphicsDevice.PresentationParameters.BackBufferWidth, GraphicsDevice.PresentationParameters.BackBufferHeight);
#elif MONOMAC
_graphicsDevice.PresentationParameters.IsFullScreen = _wantFullScreen;
// TODO: Implement multisampling (aka anti-alising) for all platforms!
_game.applyChanges(this);
#else
#if ANDROID
// Trigger a change in orientation in case the supported orientations have changed
((AndroidGameWindow)_game.Window).SetOrientation(_game.Window.CurrentOrientation, false);
#endif
// Ensure the presentation parameter orientation and buffer size matches the window
_graphicsDevice.PresentationParameters.DisplayOrientation = _game.Window.CurrentOrientation;
// Set the presentation parameters' actual buffer size to match the orientation
bool isLandscape = (0 != (_game.Window.CurrentOrientation & (DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight)));
int w = PreferredBackBufferWidth;
int h = PreferredBackBufferHeight;
_graphicsDevice.PresentationParameters.BackBufferWidth = isLandscape ? Math.Max(w, h) : Math.Min(w, h);
_graphicsDevice.PresentationParameters.BackBufferHeight = isLandscape ? Math.Min(w, h) : Math.Max(w, h);
ResetClientBounds();
#endif
// Set the new display size on the touch panel.
//
// TODO: In XNA this seems to be done as part of the
// GraphicsDevice.DeviceReset event... we need to get
// those working.
//
TouchPanel.DisplayWidth = _graphicsDevice.PresentationParameters.BackBufferWidth;
TouchPanel.DisplayHeight = _graphicsDevice.PresentationParameters.BackBufferHeight;
#if (WINDOWS || WINDOWS_UAP) && DIRECTX
if (!_firstLaunch)
{
if (IsFullScreen)
{
_game.Platform.EnterFullScreen();
}
else
{
_game.Platform.ExitFullScreen();
}
}
_firstLaunch = false;
#endif
}
private void Initialize()
{
var presentationParameters = new PresentationParameters();
presentationParameters.DepthStencilFormat = DepthFormat.Depth24;
#if (WINDOWS || WINRT) && !DESKTOPGL
_game.Window.SetSupportedOrientations(_supportedOrientations);
presentationParameters.BackBufferFormat = _preferredBackBufferFormat;
presentationParameters.BackBufferWidth = _preferredBackBufferWidth;
presentationParameters.BackBufferHeight = _preferredBackBufferHeight;
presentationParameters.DepthStencilFormat = _preferredDepthStencilFormat;
presentationParameters.IsFullScreen = false;
#if WINDOWS_PHONE
// Nothing to do!
#elif WINDOWS_UAP
presentationParameters.DeviceWindowHandle = IntPtr.Zero;
presentationParameters.SwapChainPanel = this.SwapChainPanel;
#elif WINDOWS_STOREAPP
// The graphics device can use a XAML panel or a window
// to created the default swapchain target.
if (this.SwapChainBackgroundPanel != null)
{
presentationParameters.DeviceWindowHandle = IntPtr.Zero;
presentationParameters.SwapChainBackgroundPanel = this.SwapChainBackgroundPanel;
}
else
{
presentationParameters.DeviceWindowHandle = _game.Window.Handle;
presentationParameters.SwapChainBackgroundPanel = null;
}
#else
presentationParameters.DeviceWindowHandle = _game.Window.Handle;
#endif
#else
#if MONOMAC || DESKTOPGL
presentationParameters.IsFullScreen = _wantFullScreen;
#elif WEB
presentationParameters.IsFullScreen = false;
#else
// Set "full screen" as default
presentationParameters.IsFullScreen = true;
#endif // MONOMAC
#endif // WINDOWS || WINRT
// TODO: Implement multisampling (aka anti-alising) for all platforms!
if (PreparingDeviceSettings != null)
{
GraphicsDeviceInformation gdi = new GraphicsDeviceInformation();
gdi.GraphicsProfile = GraphicsProfile; // Microsoft defaults this to Reach.
gdi.Adapter = GraphicsAdapter.DefaultAdapter;
gdi.PresentationParameters = presentationParameters;
PreparingDeviceSettingsEventArgs pe = new PreparingDeviceSettingsEventArgs(gdi);
PreparingDeviceSettings(this, pe);
presentationParameters = pe.GraphicsDeviceInformation.PresentationParameters;
GraphicsProfile = pe.GraphicsDeviceInformation.GraphicsProfile;
}
// Needs to be before ApplyChanges()
_graphicsDevice = new GraphicsDevice(GraphicsAdapter.DefaultAdapter, GraphicsProfile, presentationParameters);
#if !MONOMAC
ApplyChanges();
#endif
// Set the new display size on the touch panel.
//
// TODO: In XNA this seems to be done as part of the
// GraphicsDevice.DeviceReset event... we need to get
// those working.
//
TouchPanel.DisplayWidth = _graphicsDevice.PresentationParameters.BackBufferWidth;
TouchPanel.DisplayHeight = _graphicsDevice.PresentationParameters.BackBufferHeight;
TouchPanel.DisplayOrientation = _graphicsDevice.PresentationParameters.DisplayOrientation;
}
public void ToggleFullScreen()
{
IsFullScreen = !IsFullScreen;
#if ((WINDOWS || WINDOWS_UAP) && DIRECTX) || DESKTOPGL
ApplyChanges();
#endif
}
#if WINDOWS_STOREAPP
[CLSCompliant(false)]
public SwapChainBackgroundPanel SwapChainBackgroundPanel { get; set; }
#endif
#if WINDOWS_UAP
[CLSCompliant(false)]
public SwapChainPanel SwapChainPanel { get; set; }
#endif
public GraphicsProfile GraphicsProfile { get; set; }
public GraphicsDevice GraphicsDevice
{
get
{
return _graphicsDevice;
}
}
public bool IsFullScreen
{
get
{
#if WINDOWS_UAP
return _wantFullScreen;
#elif WINRT
return true;
#else
if (_graphicsDevice != null)
return _graphicsDevice.PresentationParameters.IsFullScreen;
return _wantFullScreen;
#endif
}
set
{
#if WINDOWS_UAP
_wantFullScreen = value;
#elif WINRT
// Just ignore this as it is not relevant on Windows 8
#elif WINDOWS && DIRECTX
_wantFullScreen = value;
#else
_wantFullScreen = value;
if (_graphicsDevice != null)
{
_graphicsDevice.PresentationParameters.IsFullScreen = value;
#if ANDROID
ForceSetFullScreen();
#endif
}
#endif
}
}
#if ANDROID
internal void ForceSetFullScreen()
{
if (IsFullScreen)
{
Game.Activity.Window.ClearFlags(Android.Views.WindowManagerFlags.ForceNotFullscreen);
Game.Activity.Window.SetFlags(WindowManagerFlags.Fullscreen, WindowManagerFlags.Fullscreen);
}
else
Game.Activity.Window.SetFlags(WindowManagerFlags.ForceNotFullscreen, WindowManagerFlags.ForceNotFullscreen);
}
#endif
/// <summary>
/// Gets or sets the boolean which defines how window switches from windowed to fullscreen state.
/// "Hard" mode(true) is slow to switch, but more effecient for performance, while "soft" mode(false) is vice versa.
/// The default value is <c>true</c>.
/// </summary>
public bool HardwareModeSwitch
{
get { return _hardwareModeSwitch; }
set
{
_hardwareModeSwitch = value;
}
}
public bool PreferMultiSampling
{
get
{
return _preferMultiSampling;
}
set
{
_preferMultiSampling = value;
}
}
public SurfaceFormat PreferredBackBufferFormat
{
get
{
return _preferredBackBufferFormat;
}
set
{
_preferredBackBufferFormat = value;
}
}
public int PreferredBackBufferHeight
{
get
{
return _preferredBackBufferHeight;
}
set
{
_preferredBackBufferHeight = value;
}
}
public int PreferredBackBufferWidth
{
get
{
return _preferredBackBufferWidth;
}
set
{
_preferredBackBufferWidth = value;
}
}
public DepthFormat PreferredDepthStencilFormat
{
get
{
return _preferredDepthStencilFormat;
}
set
{
_preferredDepthStencilFormat = value;
}
}
public bool SynchronizeWithVerticalRetrace
{
get
{
return _synchronizedWithVerticalRetrace;
}
set
{
_synchronizedWithVerticalRetrace = value;
}
}
public DisplayOrientation SupportedOrientations
{
get
{
return _supportedOrientations;
}
set
{
_supportedOrientations = value;
if (_game.Window != null)
_game.Window.SetSupportedOrientations(_supportedOrientations);
}
}
/// <summary>
/// This method is used by MonoGame Android to adjust the game's drawn to area to fill
/// as much of the screen as possible whilst retaining the aspect ratio inferred from
/// aspectRatio = (PreferredBackBufferWidth / PreferredBackBufferHeight)
///
/// NOTE: this is a hack that should be removed if proper back buffer to screen scaling
/// is implemented. To disable it's effect, in the game's constructor use:
///
/// graphics.IsFullScreen = true;
/// graphics.PreferredBackBufferHeight = Window.ClientBounds.Height;
/// graphics.PreferredBackBufferWidth = Window.ClientBounds.Width;
///
/// </summary>
internal void ResetClientBounds()
{
#if ANDROID
float preferredAspectRatio = (float)PreferredBackBufferWidth /
(float)PreferredBackBufferHeight;
float displayAspectRatio = (float)GraphicsDevice.DisplayMode.Width /
(float)GraphicsDevice.DisplayMode.Height;
float adjustedAspectRatio = preferredAspectRatio;
if ((preferredAspectRatio > 1.0f && displayAspectRatio < 1.0f) ||
(preferredAspectRatio < 1.0f && displayAspectRatio > 1.0f))
{
// Invert preferred aspect ratio if it's orientation differs from the display mode orientation.
// This occurs when user sets preferredBackBufferWidth/Height and also allows multiple supported orientations
adjustedAspectRatio = 1.0f / preferredAspectRatio;
}
const float EPSILON = 0.00001f;
var newClientBounds = new Rectangle();
if (displayAspectRatio > (adjustedAspectRatio + EPSILON))
{
// Fill the entire height and reduce the width to keep aspect ratio
newClientBounds.Height = _graphicsDevice.DisplayMode.Height;
newClientBounds.Width = (int)(newClientBounds.Height * adjustedAspectRatio);
newClientBounds.X = (_graphicsDevice.DisplayMode.Width - newClientBounds.Width) / 2;
}
else if (displayAspectRatio < (adjustedAspectRatio - EPSILON))
{
// Fill the entire width and reduce the height to keep aspect ratio
newClientBounds.Width = _graphicsDevice.DisplayMode.Width;
newClientBounds.Height = (int)(newClientBounds.Width / adjustedAspectRatio);
newClientBounds.Y = (_graphicsDevice.DisplayMode.Height - newClientBounds.Height) / 2;
}
else
{
// Set the ClientBounds to match the DisplayMode
newClientBounds.Width = GraphicsDevice.DisplayMode.Width;
newClientBounds.Height = GraphicsDevice.DisplayMode.Height;
}
// Ensure buffer size is reported correctly
_graphicsDevice.PresentationParameters.BackBufferWidth = newClientBounds.Width;
_graphicsDevice.PresentationParameters.BackBufferHeight = newClientBounds.Height;
// Set the veiwport so the (potentially) resized client bounds are drawn in the middle of the screen
_graphicsDevice.Viewport = new Viewport(newClientBounds.X, -newClientBounds.Y, newClientBounds.Width, newClientBounds.Height);
((AndroidGameWindow)_game.Window).ChangeClientBounds(newClientBounds);
// Touch panel needs latest buffer size for scaling
TouchPanel.DisplayWidth = newClientBounds.Width;
TouchPanel.DisplayHeight = newClientBounds.Height;
Android.Util.Log.Debug("MonoGame", "GraphicsDeviceManager.ResetClientBounds: newClientBounds=" + newClientBounds.ToString());
#endif
}
}
}