mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-11 16:15:38 +00:00
[SDL2] On Mac, OpenGL 3.0 or 3.1 should create 3.2 context
SDL2/Mac fails to create a 3.0 or 3.1 OpenGL context. We implicitly bump version to 3.2, otherwise 3.0 or 3.1 would give a 2.1 context.
This commit is contained in:
parent
02bf55ad7e
commit
f23b93b839
|
@ -240,9 +240,6 @@ namespace OpenTK.Platform.SDL2
|
|||
|
||||
if (major > 0)
|
||||
{
|
||||
SDL.GL.SetAttribute(ContextAttribute.CONTEXT_MAJOR_VERSION, major);
|
||||
SDL.GL.SetAttribute(ContextAttribute.CONTEXT_MINOR_VERSION, minor);
|
||||
|
||||
// Workaround for https://github.com/opentk/opentk/issues/44
|
||||
// Mac OS X desktop OpenGL 3.x/4.x contexts require require
|
||||
// ContextProfileFlags.Core, otherwise they will fail to construct.
|
||||
|
@ -250,7 +247,17 @@ namespace OpenTK.Platform.SDL2
|
|||
(flags & GraphicsContextFlags.Embedded) == 0)
|
||||
{
|
||||
cpflags |= ContextProfileFlags.CORE;
|
||||
|
||||
// According to https://developer.apple.com/graphicsimaging/opengl/capabilities/GLInfo_1075_Core.html
|
||||
// Mac OS X supports 3.2+. Indeed, requesting 3.0 or 3.1 results in failure.
|
||||
if (major == 3 && minor < 2)
|
||||
{
|
||||
minor = 2;
|
||||
}
|
||||
}
|
||||
|
||||
SDL.GL.SetAttribute(ContextAttribute.CONTEXT_MAJOR_VERSION, major);
|
||||
SDL.GL.SetAttribute(ContextAttribute.CONTEXT_MINOR_VERSION, minor);
|
||||
}
|
||||
|
||||
if ((flags & GraphicsContextFlags.Debug) != 0)
|
||||
|
|
Loading…
Reference in a new issue