mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-01-05 23:43:04 +00:00
Ava Working?
This commit is contained in:
parent
5db3568305
commit
e584f8d37d
5 changed files with 19 additions and 14 deletions
|
@ -1,4 +1,4 @@
|
|||
using OpenTK;
|
||||
// using OpenTK;
|
||||
using Silk.NET.OpenGL.Legacy;
|
||||
using Ryujinx.Common.Configuration;
|
||||
using Ryujinx.Common.Logging;
|
||||
|
|
|
@ -532,7 +532,8 @@ namespace Ryujinx.Headless.SDL2
|
|||
preferredGpuId);
|
||||
}
|
||||
|
||||
return new OpenGLRenderer();
|
||||
var openGlWindow = (OpenGLWindow)window;
|
||||
return new OpenGLRenderer(window.);
|
||||
}
|
||||
|
||||
private static Switch InitializeEmulationContext(WindowBase window, IRenderer renderer, Options options)
|
||||
|
|
|
@ -823,7 +823,7 @@ namespace Ryujinx.Ava
|
|||
}
|
||||
else
|
||||
{
|
||||
renderer = new OpenGLRenderer();
|
||||
renderer = new OpenGLRenderer((RendererHost.EmbeddedWindow as EmbeddedWindowOpenGL).CreateApi());
|
||||
}
|
||||
|
||||
BackendThreading threadingMode = ConfigurationState.Instance.Graphics.BackendThreading;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using OpenTK.Graphics.OpenGL;
|
||||
using Silk.NET.OpenGL.Legacy;
|
||||
using Ryujinx.Common.Configuration;
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.Graphics.GAL;
|
||||
|
@ -44,6 +44,13 @@ namespace Ryujinx.Ava.UI.Renderer
|
|||
throw new PlatformNotSupportedException();
|
||||
}
|
||||
|
||||
Context.Initialize(_window);
|
||||
Context.MakeCurrent(_window);
|
||||
Context.MakeCurrent(null);
|
||||
}
|
||||
|
||||
public GL CreateApi()
|
||||
{
|
||||
var flags = OpenGLContextFlags.Compat;
|
||||
if (ConfigurationState.Instance.Logger.GraphicsDebugLevel != GraphicsDebugLevel.None)
|
||||
{
|
||||
|
@ -54,12 +61,7 @@ namespace Ryujinx.Ava.UI.Renderer
|
|||
|
||||
Context = PlatformHelper.CreateOpenGLContext(graphicsMode, 3, 3, flags);
|
||||
|
||||
Context.Initialize(_window);
|
||||
Context.MakeCurrent(_window);
|
||||
|
||||
GL.LoadBindings(new OpenTKBindingsContext(Context.GetProcAddress));
|
||||
|
||||
Context.MakeCurrent(null);
|
||||
return GL.GetApi(Context.GetProcAddress);
|
||||
}
|
||||
|
||||
public void MakeCurrent(bool unbind = false, bool shouldThrow = true)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using OpenTK.Graphics.OpenGL;
|
||||
using Silk.NET.OpenGL.Legacy;
|
||||
using Ryujinx.Graphics.OpenGL;
|
||||
using SPB.Graphics;
|
||||
using SPB.Graphics.OpenGL;
|
||||
|
@ -9,11 +9,13 @@ namespace Ryujinx.Ava.UI.Renderer
|
|||
{
|
||||
class SPBOpenGLContext : IOpenGLContext
|
||||
{
|
||||
private readonly GL _api;
|
||||
private readonly OpenGLContextBase _context;
|
||||
private readonly NativeWindowBase _window;
|
||||
|
||||
private SPBOpenGLContext(OpenGLContextBase context, NativeWindowBase window)
|
||||
private SPBOpenGLContext(GL api, OpenGLContextBase context, NativeWindowBase window)
|
||||
{
|
||||
_api = api;
|
||||
_context = context;
|
||||
_window = window;
|
||||
}
|
||||
|
@ -39,11 +41,11 @@ namespace Ryujinx.Ava.UI.Renderer
|
|||
context.Initialize(window);
|
||||
context.MakeCurrent(window);
|
||||
|
||||
GL.LoadBindings(new OpenTKBindingsContext(context.GetProcAddress));
|
||||
GL api = GL.GetApi(context.GetProcAddress);
|
||||
|
||||
context.MakeCurrent(null);
|
||||
|
||||
return new SPBOpenGLContext(context, window);
|
||||
return new SPBOpenGLContext(api, context, window);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue