From 30211457260340356a16bcb5ce5df274a8ad1dc0 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Tue, 10 Jan 2006 22:12:15 +0000 Subject: Fixed problem with X11ExternalGLContext pointed out by m.engelhardt on javagaming.org forums which showed up when using JOGL with SWT git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@531 232f8b59-042b-4e1e-8c03-345bb8c30851 --- .../sun/opengl/impl/x11/X11ExternalGLContext.java | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src') diff --git a/src/classes/com/sun/opengl/impl/x11/X11ExternalGLContext.java b/src/classes/com/sun/opengl/impl/x11/X11ExternalGLContext.java index 411f7c89f..ae61c0063 100755 --- a/src/classes/com/sun/opengl/impl/x11/X11ExternalGLContext.java +++ b/src/classes/com/sun/opengl/impl/x11/X11ExternalGLContext.java @@ -51,6 +51,7 @@ public class X11ExternalGLContext extends X11GLContext { lockToolkit(); try { context = GLX.glXGetCurrentContext(); + drawable = new Drawable(GLX.glXGetCurrentDisplay()); } finally { unlockToolkit(); } @@ -80,4 +81,28 @@ public class X11ExternalGLContext extends X11GLContext { public boolean isCreated() { return created; } + + // Need to provide the display connection to extension querying APIs + class Drawable extends X11GLDrawable { + Drawable(long display) { + super(null, null); + this.display = display; + } + + public GLContext createContext(GLContext shareWith) { + throw new GLException("Should not call this"); + } + + public int getWidth() { + throw new GLException("Should not call this"); + } + + public int getHeight() { + throw new GLException("Should not call this"); + } + + public void setSize(int width, int height) { + throw new GLException("Should not call this"); + } + } } -- cgit v1.2.3