From c4cd0db6b9865c97245921d2824bcc4c1541e615 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Thu, 19 Mar 2009 00:32:21 +0000 Subject: Movement of Capabilities class and chooseCapabilities functionality into NativeWindowFactory introduced an undesirable dependence between the windowing toolkit, which can be replaced via NativeWindowFactory, and the library which implements the selection algorithm, for example OpenGL. This would prevent, for example, an easy SWT port of JOGL. To fix this, refactored chooseCapabilities into new GraphicsConfigurationFactory, the default implementation of which is currently a no-op on X11 platforms, and which is provided by JOGL in a toolkit-agnostic manner via GLX. Refactored OpenGL portions of Capabilities class back into GLCapabilities. Reintroduced GLCapabilitiesChooser interface for compatibility and to avoid having to import javax.media.nativewindow classes in most user code. Fixed problem in GLProfile where failures to load native libraries were being squelched. Reorganized build to have all outputs under build/ directory. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1884 232f8b59-042b-4e1e-8c03-345bb8c30851 --- .../classes/com/sun/opengl/impl/GLDrawableImpl.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/jogl/classes/com/sun/opengl/impl/GLDrawableImpl.java') diff --git a/src/jogl/classes/com/sun/opengl/impl/GLDrawableImpl.java b/src/jogl/classes/com/sun/opengl/impl/GLDrawableImpl.java index ce1dc6fdf..9df572af1 100644 --- a/src/jogl/classes/com/sun/opengl/impl/GLDrawableImpl.java +++ b/src/jogl/classes/com/sun/opengl/impl/GLDrawableImpl.java @@ -43,16 +43,16 @@ import javax.media.nativewindow.*; import javax.media.opengl.*; public abstract class GLDrawableImpl implements GLDrawable { - private NWCapabilities requestedCapabilities; + private GLCapabilities requestedCapabilities; protected GLDrawableImpl(GLDrawableFactory factory, NativeWindow comp, - NWCapabilities requestedCapabilities, + GLCapabilities requestedCapabilities, boolean realized) { this.factory = factory; this.component = comp; this.requestedCapabilities = - (requestedCapabilities == null) ? null : (NWCapabilities) requestedCapabilities.clone(); + (requestedCapabilities == null) ? null : (GLCapabilities) requestedCapabilities.clone(); this.realized = realized; } @@ -73,20 +73,20 @@ public abstract class GLDrawableImpl implements GLDrawable { return GLContextImpl.toHexString(hex); } - protected NWCapabilities getRequestedNWCapabilities() { + protected GLCapabilities getRequestedGLCapabilities() { return requestedCapabilities; } - public NWCapabilities getChosenNWCapabilities() { + public GLCapabilities getChosenGLCapabilities() { if (chosenCapabilities == null) return null; // Must return a new copy to avoid mutation by end user - return (NWCapabilities) chosenCapabilities.clone(); + return (GLCapabilities) chosenCapabilities.clone(); } - protected void setChosenNWCapabilities(NWCapabilities caps) { - chosenCapabilities = (caps==null) ? null : (NWCapabilities) caps.clone(); + protected void setChosenGLCapabilities(GLCapabilities caps) { + chosenCapabilities = (caps==null) ? null : (GLCapabilities) caps.clone(); } public NativeWindow getNativeWindow() { @@ -100,7 +100,7 @@ public abstract class GLDrawableImpl implements GLDrawable { public void setRealized(boolean realized) { this.realized = realized; if(!realized) { - setChosenNWCapabilities(null); + setChosenGLCapabilities(null); component.invalidate(); } } @@ -141,7 +141,7 @@ public abstract class GLDrawableImpl implements GLDrawable { protected GLDrawableFactory factory; protected NativeWindow component; - private NWCapabilities chosenCapabilities; + private GLCapabilities chosenCapabilities; // Indicates whether the component (if an onscreen context) has been // realized. Plausibly, before the component is realized the JAWT -- cgit v1.2.3