Skip to content

Commit

Permalink
[GL] Fixed issue that prevented GL core profile to be selected on Mac.
Browse files Browse the repository at this point in the history
Replaced '#if LLGL_GL3PLUS_SUPPORTED'-directive with '#if !LLGL_GL_ENABLE_OPENGL2X'.
The ...GL3PLUS... macro is no longer used.
  • Loading branch information
LukasBanana committed Nov 2, 2024
1 parent 6a2ebc0 commit 707e144
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sources/Renderer/OpenGL/Platform/MacOS/MacOSGLContext.mm
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@

bool MacOSGLContext::SetSwapInterval(int interval)
{
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_14 && LLGL_GL3PLUS_SUPPORTED
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_14 && !LLGL_GL_ENABLE_OPENGL2X
[ctx_ setValues:&interval forParameter:NSOpenGLContextParameterSwapInterval];
#else
[ctx_ setValues:&interval forParameter:NSOpenGLCPSwapInterval];
#endif
return true;
}

#if LLGL_GL3PLUS_SUPPORTED
#if !LLGL_GL_ENABLE_OPENGL2X

static NSOpenGLPixelFormatAttribute TranslateNSOpenGLProfile(const RendererConfigurationOpenGL& profile)
{
Expand All @@ -127,11 +127,11 @@ static NSOpenGLPixelFormatAttribute TranslateNSOpenGLProfile(const RendererConfi
throw std::runtime_error("failed to choose OpenGL profile (only compatibility profile, 3.2 core profile, and 4.1 core profile are supported)");
}

#endif // /LLGL_GL3PLUS_SUPPORTED
#endif // /!LLGL_GL_ENABLE_OPENGL2X

bool MacOSGLContext::CreatePixelFormat(const GLPixelFormat& pixelFormat, const RendererConfigurationOpenGL& profile)
{
#if LLGL_GL3PLUS_SUPPORTED
#if !LLGL_GL_ENABLE_OPENGL2X
const NSOpenGLPixelFormatAttribute profileAttrib = TranslateNSOpenGLProfile(profile);
#endif

Expand All @@ -142,7 +142,7 @@ static NSOpenGLPixelFormatAttribute TranslateNSOpenGLProfile(const RendererConfi
{
NSOpenGLPFAAccelerated,
NSOpenGLPFADoubleBuffer,
#if LLGL_GL3PLUS_SUPPORTED
#if !LLGL_GL_ENABLE_OPENGL2X
NSOpenGLPFAOpenGLProfile, profileAttrib,
#endif
NSOpenGLPFADepthSize, static_cast<NSOpenGLPixelFormatAttribute>(pixelFormat.depthBits),
Expand Down

0 comments on commit 707e144

Please sign in to comment.