mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-03 16:15:35 +00:00
Override context creation in GLArea.
This allows forward compatible and debug contexts to be created, and provides more descriptive exceptions in the case where the context cannot be created with the requested settings.
This commit is contained in:
parent
b1f90c380e
commit
d3f5a87809
|
@ -109,6 +109,22 @@ namespace OpenTK
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override GLContext OnCreateContext()
|
||||
{
|
||||
var gdkGLContext = Window.CreateGlContext();
|
||||
|
||||
GetRequiredVersion(out var major, out var minor);
|
||||
gdkGLContext.SetRequiredVersion(major, minor);
|
||||
|
||||
gdkGLContext.DebugEnabled = GraphicsContextFlags.HasFlag(GraphicsContextFlags.Debug);
|
||||
gdkGLContext.ForwardCompatible = GraphicsContextFlags.HasFlag(GraphicsContextFlags.ForwardCompatible);
|
||||
|
||||
gdkGLContext.Realize();
|
||||
return gdkGLContext;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Destructs this object.
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in a new issue