mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-08-02 15:47:11 +02:00
Add inbuilt Opengl renderer to window (#922)
* add gl rendering widget * embed renderer into main window * add input * fix mouse input * fix mouse coords * refresh game list after closing game, remove profiler method * rebase, hide game list progress bar while game is running * Some bug fixes Changelog: - Reapply some changes that got lost while rebasing from #904 - Make sure to guarantee exclusivity on the GL context (fixing multiple possible race conditions on Windows) - Avoid making GLRenderer disposed multiple time * add fullscreen, enable input on focus, disable aplha * addressed comments * Disable transparency in the window * fix fullscreen state, fix focus, addressed comments * nit * addressed nit Co-authored-by: Thog <thog@protonmail.com>
This commit is contained in:
parent
c464e1ec52
commit
3aa3c4261a
11 changed files with 744 additions and 469 deletions
35
Ryujinx/Ui/ScopedGlContext.cs
Normal file
35
Ryujinx/Ui/ScopedGlContext.cs
Normal file
|
@ -0,0 +1,35 @@
|
|||
using OpenTK.Graphics;
|
||||
using OpenTK.Platform;
|
||||
using System;
|
||||
using System.Threading;
|
||||
|
||||
namespace Ryujinx.Ui
|
||||
{
|
||||
class ScopedGlContext : IDisposable
|
||||
{
|
||||
private IGraphicsContext _graphicsContext;
|
||||
|
||||
private static readonly object _lock = new object();
|
||||
|
||||
public ScopedGlContext(IWindowInfo windowInfo, IGraphicsContext graphicsContext)
|
||||
{
|
||||
_graphicsContext = graphicsContext;
|
||||
|
||||
Monitor.Enter(_lock);
|
||||
|
||||
MakeCurrent(windowInfo);
|
||||
}
|
||||
|
||||
private void MakeCurrent(IWindowInfo windowInfo)
|
||||
{
|
||||
_graphicsContext.MakeCurrent(windowInfo);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
MakeCurrent(null);
|
||||
|
||||
Monitor.Exit(_lock);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue