Re: Min version macOS
Posted by
Manu on
Apr 12, 2023; 3:52pm
URL: https://forum.jogamp.org/Min-version-macOS-tp4042193p4042435.html
I ran:
export MACOSX_DEPLOYMENT_TARGET=10.9
before launching Ant but it didn't create .dylibs able to work with Mac OS X 10.9.
Then, in
jogl/src/jogl/native/macosx/MacOSXWindowSystemInterface.m, I replaced:
dispatch_sync(dispatch_get_main_queue(), ^{
contextUpdater = [[ContextUpdater alloc] initWithContext: ctx view: view];
by the call:
void * params [] = {&contextUpdater, ctx, view};
[ctx performSelectorOnMainThread:@selector(setContext) withObject:params waitUntilDone:YES];
and added this declaration (updated on April 13):
void setContext(void ** params) { // [ContextUpdater** contextUpdater, NSOpenGLContext* ctx, NSView* view]
*((ContextUpdater **)params [0]) = [[ContextUpdater alloc] initWithContext: params [1] view: params [2]];
}
I know it's an ugly patch and there must be a cleaner way to achieve the same thing, but I'm not an Objective C expert and performSelectorOnMainThread doesn't seem to accept a selector with 3 parameters.
This change compiled with
-mmacosx-version-min=10.5 flag set in
gluegen/make/gluegen-cpptasks-base.xml, and the generated .dylibs worked under Mac OS X 10.9 and macOS 13.3, but I don't know how to prove that calling
setContext works correctly.
Emmanuel Puybaret