mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Implement WPF software rendering
This commit is contained in:
parent
1d03c216d1
commit
5a0149fca8
@ -22,6 +22,8 @@ namespace Bloxstrap
|
|||||||
|
|
||||||
public LaunchFlag NoLaunchFlag { get; } = new("nolaunch");
|
public LaunchFlag NoLaunchFlag { get; } = new("nolaunch");
|
||||||
|
|
||||||
|
public LaunchFlag NoGPUFlag { get; } = new("nogpu");
|
||||||
|
|
||||||
public LaunchFlag UpgradeFlag { get; } = new("upgrade");
|
public LaunchFlag UpgradeFlag { get; } = new("upgrade");
|
||||||
|
|
||||||
public LaunchFlag PlayerFlag { get; } = new("player");
|
public LaunchFlag PlayerFlag { get; } = new("player");
|
||||||
|
@ -15,6 +15,7 @@ namespace Bloxstrap.Models.Persistable
|
|||||||
public string Locale { get; set; } = "nil";
|
public string Locale { get; set; } = "nil";
|
||||||
public bool ForceRobloxLanguage { get; set; } = false;
|
public bool ForceRobloxLanguage { get; set; } = false;
|
||||||
public bool UseFastFlagManager { get; set; } = true;
|
public bool UseFastFlagManager { get; set; } = true;
|
||||||
|
public bool WPFSoftwareRender { get; set; } = false;
|
||||||
|
|
||||||
// integration configuration
|
// integration configuration
|
||||||
public bool EnableActivityTracking { get; set; } = true;
|
public bool EnableActivityTracking { get; set; } = true;
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
using System;
|
using System.Windows;
|
||||||
using System.Collections.Generic;
|
using System.Windows.Interop;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
using Wpf.Ui.Appearance;
|
using Wpf.Ui.Appearance;
|
||||||
using Wpf.Ui.Controls;
|
using Wpf.Ui.Controls;
|
||||||
using Wpf.Ui.Mvvm.Contracts;
|
using Wpf.Ui.Mvvm.Contracts;
|
||||||
@ -25,5 +21,16 @@ namespace Bloxstrap.UI.Elements.Base
|
|||||||
_themeService.SetTheme(App.Settings.Prop.Theme.GetFinal() == Enums.Theme.Dark ? ThemeType.Dark : ThemeType.Light);
|
_themeService.SetTheme(App.Settings.Prop.Theme.GetFinal() == Enums.Theme.Dark ? ThemeType.Dark : ThemeType.Light);
|
||||||
_themeService.SetSystemAccent();
|
_themeService.SetSystemAccent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnSourceInitialized(EventArgs e)
|
||||||
|
{
|
||||||
|
if (App.Settings.Prop.WPFSoftwareRender || App.LaunchSettings.NoGPUFlag.Active)
|
||||||
|
{
|
||||||
|
if (PresentationSource.FromVisual(this) is HwndSource hwndSource)
|
||||||
|
hwndSource.CompositionTarget.RenderMode = RenderMode.SoftwareOnly;
|
||||||
|
}
|
||||||
|
|
||||||
|
base.OnSourceInitialized(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user