3aa3c4261a
* 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>
35 lines
757 B
C#
35 lines
757 B
C#
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);
|
|
}
|
|
}
|
|
}
|