Re: JOGL on Mojave, Mac OS 10.14
Posted by bjoern on
URL: https://forum.jogamp.org/JOGL-on-Mojave-Mac-OS-10-14-tp4039037p4039700.html
So I used now the new JOGL version 2.4.0 with Java3D 1.7.0_pre1.
(I also saw that there seems to be the source code for 1.7.0_pre2, but no compiled version by now?)
However, this solved indeed these warning messages:
2018-11-20 15:45:07.610 java[11053:268633] WARNING: NSWindow drag regions should only be invalidated on the Main Thread! This will throw an exception in the future. Called from (
0 AppKit 0x00007fff42af1824 -[NSWindow(NSWindow_Theme) _postWindowNeedsToResetDragMarginsUnlessPostingDisabled] + 386
1 AppKit 0x00007fff42aeebd0 -[NSWindow _initContent:styleMask:backing:defer:contentView:] + 1488
2 AppKit 0x00007fff42aee5fa -[NSWindow initWithContentRect:styleMask:backing:defer:] + 45
3 libnativewindow_macosx.jnilib 0x000000010da733fe Java_jogamp_nativewindow_macosx_OSXUtil_CreateNSWindow0 + 398
4 ??? 0x000000010e80f9f4 0x0 + 4538300916
)
This message did not appear anymore.
However, the previously described problem is not solved:
org.jogamp.java3d.IllegalRenderingStateException: Unable to make new context current after 5tries
at org.jogamp.java3d.JoglPipeline.createNewContext(JoglPipeline.java:6429)
at org.jogamp.java3d.Canvas3D.createNewContext(Canvas3D.java:4602)
at org.jogamp.java3d.Canvas3D.createNewContext(Canvas3D.java:2376)
at org.jogamp.java3d.Renderer.doWork(Renderer.java:881)
at org.jogamp.java3d.J3dThread.run(J3dThread.java:271)
DefaultRenderingErrorListener.errorOccurred:
CONTEXT_CREATION_ERROR: Renderer: Error creating Canvas3D graphics context
graphicsDevice = sun.awt.CGraphicsDevice@6a3e1b49
canvas = org.cellmicrocosmos.cm2.functionality3d.Membrane3D$1[canvas0,0,0,32x-149]
Looking to the original code in the JoglPipeline, this is what is written there:
// Apparently we are supposed to make the context current at this point
// and set up a bunch of properties
// Work around for some low end graphics driver bug, such as Intel Chipset.
// Issue 324 : Lockup J3D program and throw exception using JOGL renderer
boolean failed = false;
int failCount = 0;
int MAX_FAIL_COUNT = 5;
do {
failed = false;
int res = glContext.makeCurrent();
if (res == GLContext.CONTEXT_NOT_CURRENT) {
// System.err.println("makeCurrent fail : " + failCount);
failed = true;
++failCount;
try {
Thread.sleep(100);
}
catch (InterruptedException e) {
}
}
} while (failed && (failCount < MAX_FAIL_COUNT));
if (failCount == MAX_FAIL_COUNT) {
throw new IllegalRenderingStateException("Unable to make new context current after " + failCount + "tries");
}
MAX_FAIL_COUNT is used there trying to fix the problem, and in some cases it obviously works, and in this case now it don't. So maybe it would work if the value would be increased. Also, tweaking the Thread.sleep might be a way to fix the problem.
As my Mac Book Pro has an Intel (Wannabe Graphics) Chip, this might be indeed exactly the problem.
It's tricky! ;-) Any ideas, other than to change the source code of the JOGLPipeline completely and recompile?