public void OnOkClick(MyGuiControlButton sender) { // Update NEW settings bool somethingChanged = ReadSettingsFromControls(ref m_deviceSettingsNew, ref m_graphicsSettingsNew); // Change video mode to new one if (somethingChanged) { OnVideoModeChangedAndConfirm(MyVideoSettingsManager.ApplyVideoSettings(m_deviceSettingsNew, m_graphicsSettingsNew)); } else { CloseScreen(); } }
public override bool Draw() { if (!base.Draw()) { return(false); } if (m_doRevert) { // Revert changes - setting new video resolution must be done from Draw call, because when called // from Update while game isn't active (alt-tabed or minimized) it will fail on weird XNA exceptions OnVideoModeChanged(MyVideoSettingsManager.ApplyVideoSettings(m_deviceSettingsOld, m_graphicsSettingsOld)); m_doRevert = false; } return(true); }