diff options
author | Emmanuel Hansen <emmausssss@gmail.com> | 2022-09-19 18:05:26 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-19 15:05:26 -0300 |
commit | 6f0395538b8e8af3bba7536b44780d57e51e8697 (patch) | |
tree | 4d3f4f620dd287fc1ca38ea9ea722b6e022301dd /Ryujinx.Ava/Ui/Controls/RendererControl.cs | |
parent | b9f1ff3c7748c6a2665e76d17e86c3b7228f44fe (diff) |
Avalonia - Use embedded window for avalonia (#3674)1.1.274
* wip
* use embedded window
* fix race condition on opengl Windows
* fix glx issues on prime nvidia
* fix mouse support win32
* clean up
* addressed review
* addressed review
* fix warnings
* fix sotware keyboard dialog
* Update Ryujinx.Ava/Ui/Applet/SwkbdAppletDialog.axaml.cs
Co-authored-by: gdkchan <gab.dark.100@gmail.com>
* remove double semi
Co-authored-by: gdkchan <gab.dark.100@gmail.com>
Diffstat (limited to 'Ryujinx.Ava/Ui/Controls/RendererControl.cs')
-rw-r--r-- | Ryujinx.Ava/Ui/Controls/RendererControl.cs | 96 |
1 files changed, 0 insertions, 96 deletions
diff --git a/Ryujinx.Ava/Ui/Controls/RendererControl.cs b/Ryujinx.Ava/Ui/Controls/RendererControl.cs deleted file mode 100644 index 392f67e3..00000000 --- a/Ryujinx.Ava/Ui/Controls/RendererControl.cs +++ /dev/null @@ -1,96 +0,0 @@ -using Avalonia; -using Avalonia.Controls; -using Avalonia.Data; -using Avalonia.Media; -using Avalonia.Rendering.SceneGraph; -using Ryujinx.Common.Configuration; -using SPB.Windowing; -using System; - -namespace Ryujinx.Ava.Ui.Controls -{ - internal abstract class RendererControl : Control - { - protected object Image { get; set; } - - public event EventHandler<EventArgs> RendererInitialized; - public event EventHandler<Size> SizeChanged; - - protected Size RenderSize { get; private set; } - public bool IsStarted { get; private set; } - - public GraphicsDebugLevel DebugLevel { get; } - - private bool _isInitialized; - - protected ICustomDrawOperation DrawOperation { get; private set; } - - public RendererControl(GraphicsDebugLevel graphicsDebugLevel) - { - DebugLevel = graphicsDebugLevel; - IObservable<Rect> resizeObservable = this.GetObservable(BoundsProperty); - - resizeObservable.Subscribe(Resized); - - Focusable = true; - } - - protected void Resized(Rect rect) - { - SizeChanged?.Invoke(this, rect.Size); - - if (!rect.IsEmpty) - { - RenderSize = rect.Size * VisualRoot.RenderScaling; - DrawOperation = CreateDrawOperation(); - } - } - - protected abstract ICustomDrawOperation CreateDrawOperation(); - protected abstract void CreateWindow(); - - public override void Render(DrawingContext context) - { - if (!_isInitialized) - { - CreateWindow(); - - OnRendererInitialized(); - _isInitialized = true; - } - - if (!IsStarted || Image == null) - { - return; - } - - if (DrawOperation != null) - { - context.Custom(DrawOperation); - } - - base.Render(context); - } - - protected void OnRendererInitialized() - { - RendererInitialized?.Invoke(this, EventArgs.Empty); - } - - internal abstract void Present(object image); - - internal void Start() - { - IsStarted = true; - } - - internal void Stop() - { - IsStarted = false; - } - - public abstract void DestroyBackgroundContext(); - internal abstract void MakeCurrent(); - internal abstract void MakeCurrent(SwappableNativeWindowBase window); - } -}
\ No newline at end of file |