mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-09 09:53:47 +02:00
* refactor: merge two overlay offScreenBrowser into one * Electron support for shared overlay * Separate overlay into its own process * fix: invalid overlay texture size * Handle duplicate processes * Remove logging --------- Co-authored-by: pa <maplenagisa@gmail.com> Co-authored-by: rs189 <35667100+rs189@users.noreply.github.com>
51 lines
1.3 KiB
C#
51 lines
1.3 KiB
C#
using System;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
using NLog;
|
|
|
|
namespace VRCX.Overlay;
|
|
|
|
internal static class OverlayProgram
|
|
{
|
|
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
|
|
|
|
public static VRCXVRInterface VRCXVRInstance;
|
|
|
|
public static void OverlayMain()
|
|
{
|
|
logger.Info("VRCX Overlay starting...");
|
|
CefService.Instance.Init();
|
|
AppApiVr.Instance = new AppApiVrCef();
|
|
var isLegacy = VRCXStorage.Instance.Get("VRCX_DisableVrOverlayGpuAcceleration") == "true";
|
|
VRCXVRInstance = new VRCXVRCef(isLegacy);
|
|
VRCXVRInstance.Init();
|
|
|
|
OverlayClient.Init();
|
|
|
|
logger.Info("VRCX Overlay started...");
|
|
QuitProcess();
|
|
ApplicationConfiguration.Initialize();
|
|
var context = new ApplicationContext();
|
|
Application.Run(context);
|
|
Exit();
|
|
}
|
|
|
|
private static void Exit()
|
|
{
|
|
logger.Info("VRCX Overlay exiting...");
|
|
// CefService.Instance.Exit();
|
|
OverlayClient.Exit();
|
|
VRCXVRInstance.Exit();
|
|
Environment.Exit(0);
|
|
}
|
|
|
|
private static async Task QuitProcess()
|
|
{
|
|
await Task.Delay(5000);
|
|
while (OverlayClient.ConnectedAndActive)
|
|
{
|
|
await Task.Delay(500);
|
|
}
|
|
Exit();
|
|
}
|
|
} |