mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-25 06:35:30 +00:00
Initial support for external contexts.
This commit is contained in:
parent
ed3fabfde6
commit
b48202324b
|
@ -90,6 +90,17 @@ namespace OpenTK.Platform.Windows
|
|||
}
|
||||
}
|
||||
|
||||
public WinGLContext(IWindowInfo window)
|
||||
{
|
||||
if (window == null) throw new ArgumentNullException("window");
|
||||
|
||||
renderContext = Wgl.GetCurrentContext();
|
||||
if (renderContext == IntPtr.Zero)
|
||||
throw new InvalidOperationException("No OpenGL context is current in the calling thread.");
|
||||
|
||||
currentWindow = (WinWindowInfo)window;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region --- IGraphicsContext Members ---
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace OpenTK.Platform.X11
|
|||
GraphicsContext.GetCurrentContext = X11GLContext.GetCurrentContext;
|
||||
}
|
||||
|
||||
internal X11GLContext(GraphicsMode mode, IWindowInfo info, IGraphicsContext shared, bool directRendering)
|
||||
public X11GLContext(GraphicsMode mode, IWindowInfo info, IGraphicsContext shared, bool directRendering)
|
||||
{
|
||||
//if (mode == null) mode = GraphicsMode.Default;
|
||||
if (info == null) throw new ArgumentNullException("info", "Should point to a valid window.");
|
||||
|
@ -52,6 +52,17 @@ namespace OpenTK.Platform.X11
|
|||
CreateContext(shared, directRendering, currentWindow);
|
||||
}
|
||||
|
||||
public X11GLContext(IWindowInfo window)
|
||||
{
|
||||
if (window == null) throw new ArgumentNullException("window");
|
||||
|
||||
//renderContext = Glx.GetCurrentContext();
|
||||
//if (renderContext == IntPtr.Zero)
|
||||
// throw new InvalidOperationException("No OpenGL context is current in the calling thread.");
|
||||
|
||||
//currentWindow = window;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region --- Private Methods ---
|
||||
|
|
Loading…
Reference in a new issue