diff options
Diffstat (limited to 'src/classes/com')
-rw-r--r-- | src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java | 11 | ||||
-rw-r--r-- | src/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXContext.java | 6 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java b/src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java index 85e0ecc21..22ba775ec 100644 --- a/src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java +++ b/src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java @@ -107,11 +107,12 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { throw new IllegalArgumentException("Null target"); } target = NativeWindowFactory.getNativeWindow(target); - X11OnscreenGLXDrawable drawable = new X11OnscreenGLXDrawable(this, target); - long visualID = target.getVisualID(); - int screen = target.getScreenIndex(); - drawable.setChosenGLCapabilities((GLCapabilities) visualToGLCapsMap.get(new ScreenAndVisualIDKey(screen, visualID))); - return drawable; + return new X11OnscreenGLXDrawable(this, target); + } + + public GLCapabilities lookupCapabilitiesByScreenAndVisualID(int screenIndex, + long visualID) { + return (GLCapabilities) visualToGLCapsMap.get(new ScreenAndVisualIDKey(screenIndex, visualID)); } public GLDrawableImpl createOffscreenDrawable(GLCapabilities capabilities, diff --git a/src/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXContext.java b/src/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXContext.java index 7152a6238..f1743a8b4 100644 --- a/src/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXContext.java +++ b/src/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXContext.java @@ -60,6 +60,12 @@ public class X11OnscreenGLXContext extends X11GLXContext { protected int makeCurrentImpl() throws GLException { int lockRes = drawable.lockSurface(); + if (drawable.getChosenGLCapabilities() == null) { + X11GLXDrawableFactory factory = (X11GLXDrawableFactory) drawable.getFactory(); + NativeWindow window = drawable.getNativeWindow(); + drawable.setChosenGLCapabilities(factory.lookupCapabilitiesByScreenAndVisualID(window.getScreenIndex(), + window.getVisualID())); + } boolean exceptionOccurred = false; try { if (lockRes == NativeWindow.LOCK_SURFACE_NOT_READY) { |