Login  Register

Re: MacOSX exception: BackingLayerHost w/ unknown handle

Posted by uhok on Feb 05, 2019; 8:15pm
URL: https://forum.jogamp.org/MacOSX-exception-BackingLayerHost-w-unknown-handle-tp4039399p4039484.html

I've found this thread ( http://forum.jogamp.org/Issue-with-Java-3D-under-OpenJDK-7-Mac-OS-X-td4025259i20.html
 ), though I'm having a hard time figuring out what exactly the solution that was arrived at was.

It seems my project is using java.awt.canvas and not a custom canvas like Canvas3D


Below is how my drawable is created (trimming a bit of code out from above)

                                GLProfile glProfile = GLProfile.get(GLProfile.GL4);


                                GLCapabilities glCaps = new GLCapabilities(glProfile);
                                // This line is necessary to avoid a crash on mac
                                if (OSType.getOSType() == OSType.MacOS)
                                {
// glCaps.setFBO(true);
                                }


                                AWTGraphicsConfiguration config = AWTGraphicsConfiguration.create(canvas.getGraphicsConfiguration(), glCaps, glCaps);

                                jawtWindow = NewtFactoryAWT.getNativeWindow(canvas, config);
                                canvas.setFocusable(true);

                                GLDrawableFactory glDrawableFactory = GLDrawableFactory.getFactory(glProfile);

                                glDrawable = glDrawableFactory.createGLDrawable(jawtWindow);
                                glDrawable.setRealized(true);
                                glContext = glDrawable.createContext(null);
                                int res = glContext.makeCurrent();