Fix Mac OS X 10.9 build issue due to CGLContextObj return type. #33116
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prevents this compilation error on Mac OS X 10.9:
The issue occurs because pre-Mac OS X 10.10 the
CGLContextObj
property had a return type ofvoid *
but in 10.10 it changed to a return type ofstruct _CGLContextObject *
.Also prevents a similar error with
CGLPixelFormatObj
property.The issue appeared due to the recent addition of the call to
CVDisplayLinkSetCurrentCGDisplayFromOpenGLContext()
to work around a macOS 10.14 v-sync issue in b53f2d1.Note:
static_cast
will cause any issues on OS versions that don't require it.GLEssentials/GLEssentials/Source/Classes/OSX/GLEssentialsGLView.m
) which would avoid the cast by explicitly storing the parameters into variables before making the function call:Additional context
Initial
CGLContextObj
-related build error:Subsequent
CGLPixelFormatObj
-related build error:Mac OS X 10.9 header with
CGLContextObj
property inNSOpenGL.h
inAppKit
framework:AppKit.framework/Versions/C/Headers/NSOpenGL.h
Mac OS X 10.10 header with
CGLContextObj
property inNSOpenGL.h
inAppKit
framework:AppKit.framework/Versions/C/Headers/NSOpenGL.h
Current Godot code:
godot/platform/osx/os_osx.mm
Line 1582 in 816341a
Mac OS X 10.9 header with
CVDisplayLinkSetCurrentCGDisplayFromOpenGLContext()
function inCVDisplayLink.h
inCoreVideo
framework:CoreVideo.framework/Versions/A/Headers/CVDisplayLink.h
Equivalent Mac OS X 10.11 (the version the declaration next changed) header with
CVDisplayLinkSetCurrentCGDisplayFromOpenGLContext()
function inCVDisplayLink.h
inCoreVideo
framework:CoreVideo.framework/Versions/A/Headers/CVDisplayLink.h