diff options
author | Kenneth Russel <[email protected]> | 2005-11-09 20:11:30 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2005-11-09 20:11:30 +0000 |
commit | dba4677caf231ac26c70518a3e82651b0e01c8f2 (patch) | |
tree | 53b494a55ff1c4a00c6d2bd1dbb3e4b7e66b8b5e /src/classes/com/sun/opengl/impl/macosx | |
parent | 23e6684c5ae7047f39620e861b607db2f761799d (diff) |
Refactored JOGL's use of the JAWT to enable it to be more lazily
loaded. Separated out AWT-specific native code into a new jogl_awt
native library on all platforms. Added a static helper method to the
JAWT class to fetch the JAWT which is now called by all users. Added a
new NativeLibLoader entry point to load the native code for the AWT
implementation. Renamed the X11 platform's "lockAWT" and "unlockAWT"
methods to "lockToolkit" and "unlockToolkit", respectively. In order
to change this behavior only two methods in X11GLDrawableFactory need
to be overridden. (During the writing of this checkin comment it was
noted that these methods are currently static, but that will be fixed
in a subsequent checkin.) Added the new jogl_awt native library to the
the "dist" target's error checking code. Tested on Windows; more
testing, including build testing, is needed on other platforms.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@429 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/com/sun/opengl/impl/macosx')
-rw-r--r-- | src/classes/com/sun/opengl/impl/macosx/MacOSXGLDrawableFactory.java | 2 | ||||
-rw-r--r-- | src/classes/com/sun/opengl/impl/macosx/MacOSXOnscreenGLDrawable.java | 30 |
2 files changed, 6 insertions, 26 deletions
diff --git a/src/classes/com/sun/opengl/impl/macosx/MacOSXGLDrawableFactory.java b/src/classes/com/sun/opengl/impl/macosx/MacOSXGLDrawableFactory.java index 62b7f3b93..9b351798c 100644 --- a/src/classes/com/sun/opengl/impl/macosx/MacOSXGLDrawableFactory.java +++ b/src/classes/com/sun/opengl/impl/macosx/MacOSXGLDrawableFactory.java @@ -51,7 +51,7 @@ import com.sun.opengl.impl.*; public class MacOSXGLDrawableFactory extends GLDrawableFactoryImpl { static { - NativeLibLoader.load(); + NativeLibLoader.loadCore(); } public GraphicsConfiguration chooseGraphicsConfiguration(GLCapabilities capabilities, diff --git a/src/classes/com/sun/opengl/impl/macosx/MacOSXOnscreenGLDrawable.java b/src/classes/com/sun/opengl/impl/macosx/MacOSXOnscreenGLDrawable.java index 4d0f16623..c9e993237 100644 --- a/src/classes/com/sun/opengl/impl/macosx/MacOSXOnscreenGLDrawable.java +++ b/src/classes/com/sun/opengl/impl/macosx/MacOSXOnscreenGLDrawable.java @@ -52,7 +52,6 @@ public class MacOSXOnscreenGLDrawable extends MacOSXGLDrawable { public static final int LOCK_SURFACE_CHANGED = 2; public static final int LOCK_SUCCESS = 3; - private static JAWT jawt; protected Component component; private List/*<WeakReference<GLContext>>*/ createdContexts = @@ -134,7 +133,7 @@ public class MacOSXOnscreenGLDrawable extends MacOSXGLDrawable { if (nsView != 0) { throw new GLException("Surface already locked"); } - ds = getJAWT().GetDrawingSurface(component); + ds = JAWT.getJAWT().GetDrawingSurface(component); if (ds == null) { // Widget not yet realized return LOCK_SURFACE_NOT_READY; @@ -165,7 +164,7 @@ public class MacOSXOnscreenGLDrawable extends MacOSXGLDrawable { if (dsi == null) { // Widget not yet realized ds.Unlock(); - getJAWT().FreeDrawingSurface(ds); + JAWT.getJAWT().FreeDrawingSurface(ds); ds = null; return LOCK_SURFACE_NOT_READY; } @@ -175,7 +174,7 @@ public class MacOSXOnscreenGLDrawable extends MacOSXGLDrawable { // Widget not yet realized ds.FreeDrawingSurfaceInfo(dsi); ds.Unlock(); - getJAWT().FreeDrawingSurface(ds); + JAWT.getJAWT().FreeDrawingSurface(ds); ds = null; dsi = null; return LOCK_SURFACE_NOT_READY; @@ -185,7 +184,7 @@ public class MacOSXOnscreenGLDrawable extends MacOSXGLDrawable { // Widget not yet realized ds.FreeDrawingSurfaceInfo(dsi); ds.Unlock(); - getJAWT().FreeDrawingSurface(ds); + JAWT.getJAWT().FreeDrawingSurface(ds); ds = null; dsi = null; macosxdsi = null; @@ -200,29 +199,10 @@ public class MacOSXOnscreenGLDrawable extends MacOSXGLDrawable { } ds.FreeDrawingSurfaceInfo(dsi); ds.Unlock(); - getJAWT().FreeDrawingSurface(ds); + JAWT.getJAWT().FreeDrawingSurface(ds); ds = null; dsi = null; macosxdsi = null; nsView = 0; } - - //---------------------------------------------------------------------- - // Internals only below this point - // - - private JAWT getJAWT() - { - if (jawt == null) - { - JAWT j = JAWT.create(); - j.version(JAWTFactory.JAWT_VERSION_1_4); - if (!JAWTFactory.JAWT_GetAWT(j)) - { - throw new RuntimeException("Unable to initialize JAWT"); - } - jawt = j; - } - return jawt; - } } |