/// <summary> /// Called when display mode has changed /// </summary> /// <param name="sender">Sender</param> /// <param name="args">Arguments</param> private void OnDisplayModeChanged(object sender, WindowDisplayModeChangedEventArgs args) { if (DisplayModeChanged != null) { DisplayModeChanged(sender, args); } }
/// <summary> /// Called before rendering /// </summary> protected override void PreRender() { base.PreRender(); if (!_deviceDirty) return; DeviceManager.ApplyChanges(); _deviceDirty = false; if (_displayModeChanged) { WindowDisplayModeChangedEventArgs args = new WindowDisplayModeChangedEventArgs(DeviceManager.GraphicsDevice.Adapter.CurrentDisplayMode, this); OnDisplayModeChanged(this, args); _displayModeChanged = false; } if (_fullScreenChanged) { WindowFullScreenSwitchedEventArgs args = new WindowFullScreenSwitchedEventArgs(DeviceManager.IsFullScreen, this); OnFullScreenSwitched(this, args); _fullScreenChanged = false; } }