mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-23 12:15:37 +00:00
Added a second terminating 0 to attribute list, trying to work around issue [#1352]: "Occasional AccessViolationExceptions when creating the GLControl".
This commit is contained in:
parent
f03a6ddc76
commit
a0e95055e3
|
@ -102,6 +102,11 @@ namespace OpenTK.Platform.Windows
|
||||||
#warning "This is not entirely correct: Embedded is not a valid flag! We need to add a GetARBContextFlags(GraphicsContextFlags) method."
|
#warning "This is not entirely correct: Embedded is not a valid flag! We need to add a GetARBContextFlags(GraphicsContextFlags) method."
|
||||||
attributes.Add((int)flags);
|
attributes.Add((int)flags);
|
||||||
}
|
}
|
||||||
|
// According to the docs, " <attribList> specifies a list of attributes for the context.
|
||||||
|
// The list consists of a sequence of <name,value> pairs terminated by the
|
||||||
|
// value 0. [...]"
|
||||||
|
// Is this a single 0, or a <0, 0> pair? (Defensive coding: add two zeroes just in case).
|
||||||
|
attributes.Add(0);
|
||||||
attributes.Add(0);
|
attributes.Add(0);
|
||||||
|
|
||||||
Handle = new ContextHandle(
|
Handle = new ContextHandle(
|
||||||
|
|
|
@ -110,9 +110,15 @@ namespace OpenTK.Platform.X11
|
||||||
attributes.Add(minor);
|
attributes.Add(minor);
|
||||||
if (flags != 0)
|
if (flags != 0)
|
||||||
{
|
{
|
||||||
|
#warning "This is not entirely correct: Embedded is not a valid flag! We need to add a GetARBContextFlags(GraphicsContextFlags) method."
|
||||||
attributes.Add((int)ArbCreateContext.Flags);
|
attributes.Add((int)ArbCreateContext.Flags);
|
||||||
attributes.Add((int)flags);
|
attributes.Add((int)flags);
|
||||||
}
|
}
|
||||||
|
// According to the docs, " <attribList> specifies a list of attributes for the context.
|
||||||
|
// The list consists of a sequence of <name,value> pairs terminated by the
|
||||||
|
// value 0. [...]"
|
||||||
|
// Is this a single 0, or a <0, 0> pair? (Defensive coding: add two zeroes just in case).
|
||||||
|
attributes.Add(0);
|
||||||
attributes.Add(0);
|
attributes.Add(0);
|
||||||
|
|
||||||
Handle = new ContextHandle(Glx.Arb.CreateContextAttribs(Display, *fbconfigs,
|
Handle = new ContextHandle(Glx.Arb.CreateContextAttribs(Display, *fbconfigs,
|
||||||
|
|
Loading…
Reference in a new issue