Posted by
InteractiveMesh on
Dec 02, 2012; 4:01pm
URL: https://forum.jogamp.org/Issue-with-Java-3D-under-OpenJDK-7-Mac-OS-X-tp4025259p4027375.html
A Canvas3D with implemented interface 'OffscreenLayerOption' and adapted context creation according to the design of AWT GLCanvas and as asked for by Sven above doesn't throw the GLException 'BackingLayerHost w/ unknown handle' anymore. Sweet Home 3D starts - unfortunately - with a not correctly positioned Canvas3D within a JSplitPane.
Emmanuel, thanks a lot for testing and providing pictures of this test case.
I transferred my changes into Harvey's Canvas3D and JoglPipeline classes and in agreement with him I make them available here. The file also includes the pictures : PastedGraphic-3.png/test result, PastedGraphic-4.png/default.
Changes in short:
Canvas3D/OffscreenLayerOption
// Accessed in JoglPipeline.createNewContext
JAWTWindow jawtWindow = null;
boolean shallUseOffscreenLayer = false;
public void setShallUseOffscreenLayer(boolean v) {
shallUseOffscreenLayer = v;
}
public final boolean getShallUseOffscreenLayer() {
return shallUseOffscreenLayer;
}
public final boolean isOffscreenLayerSurfaceEnabled() {
final JAWTWindow jawtwindow = jawtWindow;
if (jawtwindow != null) {
return jawtwindow.isOffscreenLayerSurfaceEnabled();
}
return false;
}
JoglPipeline.createNewContext
cv.jawtWindow = (JAWTWindow)NativeWindowFactory.getNativeWindow(cv, awtGraphicsConfiguration);
cv.jawtWindow.setShallUseOffscreenLayer(cv.shallUseOffscreenLayer);
cv.jawtWindow.lockSurface();
try {
draw = GLDrawableFactory.getFactory(profile).createGLDrawable(cv.jawtWindow)
context = draw.createContext(context(shareCtx));
}
finally {
cv.jawtWindow.unlockSurface();
}
Emmanuel, is the Canvas3D positioned correctly when displayed in the separated window?
August
mac-jre-issue-testcase.zip