mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-23 02:05:29 +00:00
Initialize an OpenTK::GraphicsContext from the foreign GDK context.
This commit is contained in:
parent
d677aef6c3
commit
456d7cde37
|
@ -386,9 +386,14 @@ namespace OpenTK
|
||||||
_WindowInfo = XWindowInfoInitializer.Initialize(graphicsMode, this.Display.Handle, this.Screen.Number, widgetWindowHandle, this.Screen.RootWindow.Handle);
|
_WindowInfo = XWindowInfoInitializer.Initialize(graphicsMode, this.Display.Handle, this.Screen.Number, widgetWindowHandle, this.Screen.RootWindow.Handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
// GraphicsContext
|
// Make the GDK GL context current
|
||||||
|
Context.MakeCurrent();
|
||||||
|
|
||||||
_GraphicsContext = new GraphicsContext(graphicsMode, _WindowInfo, GlVersionMajor, GlVersionMinor, GraphicsContextFlags);
|
// Create an OpenTK graphics context using the GdkGLContext as a foreign context
|
||||||
|
// Since the GDK context is already created and has been made current, we can retrieve its handle.
|
||||||
|
var gdkContextHandle = Factory.Default.CreateGetCurrentGraphicsContext()();
|
||||||
|
|
||||||
|
_GraphicsContext = new GraphicsContext(gdkContextHandle, _WindowInfo, null, GlVersionMajor, GlVersionMinor, GraphicsContextFlags);
|
||||||
_GraphicsContext.MakeCurrent(_WindowInfo);
|
_GraphicsContext.MakeCurrent(_WindowInfo);
|
||||||
|
|
||||||
if (GraphicsContext.ShareContexts)
|
if (GraphicsContext.ShareContexts)
|
||||||
|
|
Loading…
Reference in a new issue