Compare commits

...

5 Commits

Author SHA1 Message Date
Evan Husted
1bc0159139 Once again, I am stupid 2024-12-27 00:41:50 -06:00
Evan Husted
0733b7d0a1 chore: Remove duplicate VSyncMode enum in GAL 2024-12-27 00:38:12 -06:00
Evan Husted
9df1366fa1 I may be stu-- nah. I am here. I am stupid for this one. 2024-12-27 00:00:29 -06:00
Evan Husted
c73b5bdf46 metal: wip: allow getting/setting developerHUDProperies 2024-12-26 23:58:55 -06:00
Evan Husted
9754d247b5 UI: Directly proxy window properties on the view model back to the stored window 2024-12-26 23:32:53 -06:00
14 changed files with 40 additions and 57 deletions

View File

@@ -1,3 +1,4 @@
using Ryujinx.Common.Configuration;
using System; using System;
namespace Ryujinx.Graphics.GAL namespace Ryujinx.Graphics.GAL

View File

@@ -1,3 +1,4 @@
using Ryujinx.Common.Configuration;
using Ryujinx.Graphics.GAL.Multithreading.Commands.Window; using Ryujinx.Graphics.GAL.Multithreading.Commands.Window;
using Ryujinx.Graphics.GAL.Multithreading.Model; using Ryujinx.Graphics.GAL.Multithreading.Model;
using Ryujinx.Graphics.GAL.Multithreading.Resources; using Ryujinx.Graphics.GAL.Multithreading.Resources;

View File

@@ -1,9 +0,0 @@
namespace Ryujinx.Graphics.GAL
{
public enum VSyncMode
{
Switch,
Unbounded,
Custom
}
}

View File

@@ -6,16 +6,25 @@ using System.Runtime.Versioning;
namespace Ryujinx.Graphics.Metal.SharpMetalExtensions namespace Ryujinx.Graphics.Metal.SharpMetalExtensions
{ {
[SupportedOSPlatform("OSX")] [SupportedOSPlatform("macOS")]
public static class CAMetalLayerExtensions public static class CAMetalLayerExtensions
{ {
private static readonly Selector sel_displaySyncEnabled = "displaySyncEnabled"; private static readonly Selector sel_displaySyncEnabled = "displaySyncEnabled";
private static readonly Selector sel_setDisplaySyncEnabled = "setDisplaySyncEnabled:"; private static readonly Selector sel_setDisplaySyncEnabled = "setDisplaySyncEnabled:";
private static readonly Selector sel_developerHUDProperties = "developerHUDProperties";
private static readonly Selector sel_setDeveloperHUDProperties = "setDeveloperHUDProperties:";
public static bool IsDisplaySyncEnabled(this CAMetalLayer metalLayer) public static bool IsDisplaySyncEnabled(this CAMetalLayer metalLayer)
=> ObjectiveCRuntime.bool_objc_msgSend(metalLayer.NativePtr, sel_displaySyncEnabled); => ObjectiveCRuntime.bool_objc_msgSend(metalLayer.NativePtr, sel_displaySyncEnabled);
public static void SetDisplaySyncEnabled(this CAMetalLayer metalLayer, bool enabled) public static void SetDisplaySyncEnabled(this CAMetalLayer metalLayer, bool enabled)
=> ObjectiveCRuntime.objc_msgSend(metalLayer.NativePtr, sel_setDisplaySyncEnabled, enabled); => ObjectiveCRuntime.objc_msgSend(metalLayer.NativePtr, sel_setDisplaySyncEnabled, enabled);
public static nint GetDeveloperHudProperties(this CAMetalLayer metalLayer)
=> ObjectiveCRuntime.IntPtr_objc_msgSend(metalLayer.NativePtr, sel_developerHUDProperties);
public static void SetDeveloperHudProperties(this CAMetalLayer metalLayer, nint dictionaryPointer)
=> ObjectiveCRuntime.objc_msgSend(metalLayer.NativePtr, sel_setDeveloperHUDProperties, dictionaryPointer);
} }
} }

View File

@@ -1,3 +1,4 @@
using Ryujinx.Common.Configuration;
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL;
using Ryujinx.Graphics.Metal.Effects; using Ryujinx.Graphics.Metal.Effects;
@@ -6,6 +7,8 @@ using SharpMetal.ObjectiveCCore;
using SharpMetal.QuartzCore; using SharpMetal.QuartzCore;
using System; using System;
using System.Runtime.Versioning; using System.Runtime.Versioning;
using AntiAliasing = Ryujinx.Graphics.GAL.AntiAliasing;
using ScalingFilter = Ryujinx.Graphics.GAL.ScalingFilter;
namespace Ryujinx.Graphics.Metal namespace Ryujinx.Graphics.Metal
{ {

View File

@@ -1,9 +1,12 @@
using OpenTK.Graphics.OpenGL; using OpenTK.Graphics.OpenGL;
using Ryujinx.Common.Configuration;
using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL;
using Ryujinx.Graphics.OpenGL.Effects; using Ryujinx.Graphics.OpenGL.Effects;
using Ryujinx.Graphics.OpenGL.Effects.Smaa; using Ryujinx.Graphics.OpenGL.Effects.Smaa;
using Ryujinx.Graphics.OpenGL.Image; using Ryujinx.Graphics.OpenGL.Image;
using System; using System;
using AntiAliasing = Ryujinx.Graphics.GAL.AntiAliasing;
using ScalingFilter = Ryujinx.Graphics.GAL.ScalingFilter;
namespace Ryujinx.Graphics.OpenGL namespace Ryujinx.Graphics.OpenGL
{ {

View File

@@ -1,9 +1,12 @@
using Ryujinx.Common.Configuration;
using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL;
using Ryujinx.Graphics.Vulkan.Effects; using Ryujinx.Graphics.Vulkan.Effects;
using Silk.NET.Vulkan; using Silk.NET.Vulkan;
using Silk.NET.Vulkan.Extensions.KHR; using Silk.NET.Vulkan.Extensions.KHR;
using System; using System;
using System.Linq; using System.Linq;
using AntiAliasing = Ryujinx.Graphics.GAL.AntiAliasing;
using ScalingFilter = Ryujinx.Graphics.GAL.ScalingFilter;
using VkFormat = Silk.NET.Vulkan.Format; using VkFormat = Silk.NET.Vulkan.Format;
namespace Ryujinx.Graphics.Vulkan namespace Ryujinx.Graphics.Vulkan

View File

@@ -1,5 +1,8 @@
using Ryujinx.Common.Configuration;
using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL;
using System; using System;
using AntiAliasing = Ryujinx.Graphics.GAL.AntiAliasing;
using ScalingFilter = Ryujinx.Graphics.GAL.ScalingFilter;
namespace Ryujinx.Graphics.Vulkan namespace Ryujinx.Graphics.Vulkan
{ {

View File

@@ -9,7 +9,6 @@ using Ryujinx.HLE.HOS.Services.Account.Acc;
using Ryujinx.HLE.HOS.SystemState; using Ryujinx.HLE.HOS.SystemState;
using Ryujinx.HLE.UI; using Ryujinx.HLE.UI;
using System; using System;
using VSyncMode = Ryujinx.Common.Configuration.VSyncMode;
namespace Ryujinx.HLE namespace Ryujinx.HLE
{ {

View File

@@ -10,7 +10,6 @@ using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using VSyncMode = Ryujinx.Common.Configuration.VSyncMode;
namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
{ {

View File

@@ -311,7 +311,7 @@ namespace Ryujinx.Ava
Device.VSyncMode = e.NewValue; Device.VSyncMode = e.NewValue;
Device.UpdateVSyncInterval(); Device.UpdateVSyncInterval();
} }
_renderer.Window?.ChangeVSyncMode((Ryujinx.Graphics.GAL.VSyncMode)e.NewValue); _renderer.Window?.ChangeVSyncMode(e.NewValue);
_viewModel.ShowCustomVSyncIntervalPicker = (e.NewValue == VSyncMode.Custom); _viewModel.ShowCustomVSyncIntervalPicker = (e.NewValue == VSyncMode.Custom);
} }
@@ -1074,7 +1074,7 @@ namespace Ryujinx.Ava
Device.Gpu.SetGpuThread(); Device.Gpu.SetGpuThread();
Device.Gpu.InitializeShaderCache(_gpuCancellationTokenSource.Token); Device.Gpu.InitializeShaderCache(_gpuCancellationTokenSource.Token);
_renderer.Window.ChangeVSyncMode((Ryujinx.Graphics.GAL.VSyncMode)Device.VSyncMode); _renderer.Window.ChangeVSyncMode(Device.VSyncMode);
while (_isActive) while (_isActive)
{ {

View File

@@ -33,11 +33,8 @@ namespace Ryujinx.Ava
.ApplicationLifetime.Cast<IClassicDesktopStyleApplicationLifetime>() .ApplicationLifetime.Cast<IClassicDesktopStyleApplicationLifetime>()
.MainWindow.Cast<MainWindow>(); .MainWindow.Cast<MainWindow>();
public static bool IsClipboardAvailable(out IClipboard clipboard) public static bool IsClipboardAvailable(out IClipboard clipboard)
{ => (clipboard = MainWindow.Clipboard) != null;
clipboard = MainWindow.Clipboard;
return clipboard != null;
}
public static void SetTaskbarProgress(TaskBarProgressBarState state) => MainWindow.PlatformFeatures.SetTaskBarProgressBarState(state); public static void SetTaskbarProgress(TaskBarProgressBarState state) => MainWindow.PlatformFeatures.SetTaskBarProgressBarState(state);
public static void SetTaskbarProgressValue(ulong current, ulong total) => MainWindow.PlatformFeatures.SetTaskBarProgressBarValue(current, total); public static void SetTaskbarProgressValue(ulong current, ulong total) => MainWindow.PlatformFeatures.SetTaskBarProgressBarValue(current, total);

View File

@@ -109,13 +109,8 @@ namespace Ryujinx.Ava.UI.ViewModels
private bool _areMimeTypesRegistered = FileAssociationHelper.AreMimeTypesRegistered; private bool _areMimeTypesRegistered = FileAssociationHelper.AreMimeTypesRegistered;
private bool _canUpdate = true; private bool _canUpdate = true;
private Cursor _cursor;
private string _title;
private ApplicationData _currentApplicationData; private ApplicationData _currentApplicationData;
private readonly AutoResetEvent _rendererWaitEvent; private readonly AutoResetEvent _rendererWaitEvent;
private WindowState _windowState;
private double _windowWidth;
private double _windowHeight;
private int _customVSyncInterval; private int _customVSyncInterval;
private int _customVSyncIntervalPercentageProxy; private int _customVSyncIntervalPercentageProxy;
@@ -216,7 +211,7 @@ namespace Ryujinx.Ava.UI.ViewModels
public bool CanUpdate public bool CanUpdate
{ {
get => _canUpdate && EnableNonGameRunningControls && Updater.CanUpdate(false); get => _canUpdate && EnableNonGameRunningControls && Updater.CanUpdate();
set set
{ {
_canUpdate = value; _canUpdate = value;
@@ -226,12 +221,8 @@ namespace Ryujinx.Ava.UI.ViewModels
public Cursor Cursor public Cursor Cursor
{ {
get => _cursor; get => Window.Cursor;
set set => Window.Cursor = value;
{
_cursor = value;
OnPropertyChanged();
}
} }
public ReadOnlyObservableCollection<ApplicationData> AppsObservableList public ReadOnlyObservableCollection<ApplicationData> AppsObservableList
@@ -813,35 +804,23 @@ namespace Ryujinx.Ava.UI.ViewModels
public WindowState WindowState public WindowState WindowState
{ {
get => _windowState; get => Window.WindowState;
internal set internal set
{ {
_windowState = value; Window.WindowState = value;
OnPropertyChanged();
} }
} }
public double WindowWidth public double WindowWidth
{ {
get => _windowWidth; get => Window.Width;
set set => Window.Width = value;
{
_windowWidth = value;
OnPropertyChanged();
}
} }
public double WindowHeight public double WindowHeight
{ {
get => _windowHeight; get => Window.Height;
set set => Window.Height = value;
{
_windowHeight = value;
OnPropertyChanged();
}
} }
public bool IsGrid => Glyph == Glyph.Grid; public bool IsGrid => Glyph == Glyph.Grid;
@@ -889,11 +868,11 @@ namespace Ryujinx.Ava.UI.ViewModels
public string Title public string Title
{ {
get => _title; get => Window.Title;
set set
{ {
_title = value; Window.Title = value;
OnPropertyChanged(); OnPropertyChanged();
} }
} }

View File

@@ -9,11 +9,6 @@
xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers" xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers"
xmlns:controls="clr-namespace:Ryujinx.Ava.UI.Controls" xmlns:controls="clr-namespace:Ryujinx.Ava.UI.Controls"
xmlns:main="clr-namespace:Ryujinx.Ava.UI.Views.Main" xmlns:main="clr-namespace:Ryujinx.Ava.UI.Views.Main"
Cursor="{Binding Cursor}"
Title="{Binding Title}"
WindowState="{Binding WindowState}"
Width="{Binding WindowWidth}"
Height="{Binding WindowHeight}"
MinWidth="800" MinWidth="800"
MinHeight="500" MinHeight="500"
d:DesignHeight="720" d:DesignHeight="720"